Skip to content

Commit

Permalink
DM: use cookiecutter
Browse files Browse the repository at this point in the history
  • Loading branch information
deanm1278 committed Oct 18, 2017
1 parent 736620b commit 8c73978
Show file tree
Hide file tree
Showing 11 changed files with 171 additions and 252 deletions.
2 changes: 1 addition & 1 deletion .gitignore
@@ -1,3 +1,3 @@
__pycache__
_build
*.pyc
*.mpy
53 changes: 53 additions & 0 deletions .travis.yml
@@ -0,0 +1,53 @@
# Travis CI configuration for automated .mpy file generation.
# Author: Tony DiCola
# License: Public Domain
# This configuration will work with Travis CI (travis-ci.org) to automacially
# build .mpy files for CircuitPython when a new tagged release is created. This
# file is relatively generic and can be shared across multiple repositories by
# following these steps:
# 1. Copy this file into a .travis.yml file in the root of the repository.
# 2. Change the deploy > file section below to list each of the .mpy files
# that should be generated. The config will automatically look for
# .py files with the same name as the source for generating the .mpy files.
# Note that the .mpy extension should be lower case!
# 3. Commit the .travis.yml file and push it to GitHub.
# 4. Go to travis-ci.org and find the repository (it needs to be setup to access
# your github account, and your github account needs access to write to the
# repo). Flip the 'ON' switch on for Travis and the repo, see the Travis
# docs for more details: https://docs.travis-ci.com/user/getting-started/
# 5. Get a GitHub 'personal access token' which has at least 'public_repo' or
# 'repo' scope: https://help.github.com/articles/creating-an-access-token-for-command-line-use/
# Keep this token safe and secure! Anyone with the token will be able to
# access and write to your GitHub repositories. Travis will use the token
# to attach the .mpy files to the release.
# 6. In the Travis CI settings for the repository that was enabled find the
# environment variable editing page: https://docs.travis-ci.com/user/environment-variables/#Defining-Variables-in-Repository-Settings
# Add an environment variable named GITHUB_TOKEN and set it to the value
# of the GitHub personal access token above. Keep 'Display value in build
# log' flipped off.
# 7. That's it! Tag a release and Travis should go to work to add .mpy files
# to the release. It takes about a 2-3 minutes for a worker to spin up,
# build mpy-cross, and add the binaries to the release.
language: generic

sudo: true

deploy:
provider: releases
api_key: $GITHUB_TOKEN
file:
- "adafruit_ina219.mpy"
skip_cleanup: true
on:
tags: true

before_install:
- sudo apt-get -yqq update
- sudo apt-get install -y build-essential git python python-pip
- git clone https://github.com/adafruit/circuitpython.git
- make -C circuitpython/mpy-cross
- export PATH=$PATH:$PWD/circuitpython/mpy-cross/
- sudo pip install shyaml

before_deploy:
- shyaml get-values deploy.file < .travis.yml | sed 's/.mpy/.py/' | xargs -L1 mpy-cross
74 changes: 74 additions & 0 deletions CODE_OF_CONDUCT.md
@@ -0,0 +1,74 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at support@adafruit.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
2 changes: 1 addition & 1 deletion LICENSE
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2017 Dean Miller
Copyright (c) 2017 Dean Miller for Adafruit Industries

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
21 changes: 14 additions & 7 deletions README.rst
@@ -1,16 +1,16 @@

Adafruit CircuitPython INA219 Library
=====================================
Introduction
============

.. image:: https://readthedocs.org/projects/adafruit-circuitpython-ina219/badge/?version=latest
:target: https://circuitpython.readthedocs.io/projects/ina219/en/latest/
:alt: Documentation Status

.. image :: https://img.shields.io/discord/327254708534116352.svg
:target: https://adafru.it/discord
:target: https://discord.gg/nBQh6qu
:alt: Discord
CircuitPython driver for the `INA219 current sensor <https://www.adafruit.com/product/904>`_.
TODO

Dependencies
=============
Expand All @@ -23,10 +23,17 @@ Please ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloading
`the Adafruit library and driver bundle <https://github.com/adafruit/Adafruit_CircuitPython_Bundle>`_.

Usage Notes
===========
Usage Example
=============

TODO

Contributing
============

see `example <https://github.com/adafruit/Adafruit_CircuitPython_INA219/blob/master/examples/get_current.py>`_
Contributions are welcome! Please read our `Code of Conduct
<https://github.com/adafruit/Adafruit_CircuitPython_ina219/blob/master/CODE_OF_CONDUCT.md>`_
before contributing to help this project stay welcoming.

API Reference
=============
Expand Down
1 change: 0 additions & 1 deletion __init__.py

This file was deleted.

12 changes: 10 additions & 2 deletions INA219.py → adafruit_ina219.py
@@ -1,6 +1,6 @@
# The MIT License (MIT)
#
# Copyright (c) 2017 Dean Miller for Adafruit Industries.
# Copyright (c) 2017 Dean Miller for Adafruit Industries
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand All @@ -19,6 +19,14 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
"""
`adafruit_ina219`
====================================================
TODO(description)
* Author(s): Dean Miller
"""

from micropython import const
from adafruit_bus_device.i2c_device import I2CDevice
Expand Down Expand Up @@ -474,4 +482,4 @@ def to_signed(self, num):
v = num
if(num > 0x7FFF):
v -= 0x10000
return v
return v
2 changes: 2 additions & 0 deletions api.rst
@@ -1,3 +1,5 @@

.. If you created a package, create one automodule per module in the package.
.. automodule:: adafruit_ina219
:members:

0 comments on commit 8c73978

Please sign in to comment.