Skip to content

Commit 6d7c10c

Browse files
authored
Merge pull request #17 from kattni/pypi-setup
PyPI setup.
2 parents 353c107 + 62e7564 commit 6d7c10c

File tree

7 files changed

+117
-25
lines changed

7 files changed

+117
-25
lines changed

.travis.yml

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,32 @@
1-
# This is a common .travis.yml for generating library release zip files for
2-
# CircuitPython library releases using circuitpython-build-tools.
3-
# See https://github.com/adafruit/circuitpython-build-tools for detailed setup
4-
# instructions.
5-
61
dist: trusty
72
sudo: false
83
language: python
94
python:
10-
- "3.6"
11-
5+
- '3.6'
126
cache:
13-
pip: true
14-
7+
pip: true
158
deploy:
16-
provider: releases
17-
api_key: $GITHUB_TOKEN
9+
- provider: releases
10+
api_key: "$GITHUB_TOKEN"
1811
file_glob: true
19-
file: $TRAVIS_BUILD_DIR/bundles/*
12+
file: "$TRAVIS_BUILD_DIR/bundles/*"
2013
skip_cleanup: true
2114
overwrite: true
2215
on:
2316
tags: true
24-
17+
- provider: pypi
18+
user: adafruit-travis
19+
on:
20+
tags: true
21+
password:
22+
secure: NjnFwxciOVjDx51McCXiwPbfkMJajWlvLinWlC6XaJOPm/gTp5BbwTe9kJFJpzlV8JXTLoldCa/tC966JMSKle9O9DYyLgKf2PupGvmQxvIjoZBTqRGZqATXrlg9bd37N3hH0giNpbz2JQPZZ41BJ1+B2WqgSLecCot+BuCkqgVJBicjAS8wvtCB+iz2iDq+HwwcHU8QbBCg5yHAxQeEFWLFoZkkjYnY+8InY4JJMR8qgWDhQr32y0tJYqCXb1ys4si9SkUyQLAALKSN871uwAvCHfY4LmT7/Kd8elDayKauTUV0T9LB+nsz6XcZ6mpXV+OG6/RUrPZRpjO3t9QUa5RPlRUDXRWcht2gx0SvBcJ3k79V6snEFphxysMHrcs3Q+tmTiBKHsujb3bvHEAgnGsnztd7rTmb9lqMtbwaDtfg/MtGx7gK/a3j6ZqhwcfqcRvHF7QabaIZgFZDiR97mUrSmS+gQ3lmRSrY141NdwEU0WUHtwUquDcNTVNbKKEFBqvzf4FQg31as/rEEfUyymG8qKbKeyVUUAyfjb16VP7XNCSWg1tti53wRFoA9JkMBtNL5KYUM4wEdXwV5Cm8fEfNC4MSQplq52SbycbzopPnJnaxQfKj3SzKgRAWW9A3VWFKyFfxtIIdefyrkUoBe2+Uj/jwTSr4fe/zBnbsTrE=
2523
install:
26-
- pip install pylint circuitpython-build-tools Sphinx sphinx-rtd-theme
27-
- pip install --force-reinstall pylint==1.9.2
28-
24+
- pip install -r requirements.txt
25+
- pip install pylint circuitpython-build-tools Sphinx sphinx-rtd-theme
26+
- pip install --force-reinstall pylint==1.9.2
2927
script:
30-
- pylint adafruit_featherwing/*.py
31-
- ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name examples/**/*.py)
32-
- circuitpython-build-bundles --filename_prefix adafruit-circuitpython-featherwing --library_location .
33-
- cd docs && sphinx-build -E -W -b html . _build/html
28+
- pylint adafruit_featherwing/*.py
29+
- ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name examples/**/*.py)
30+
- circuitpython-build-bundles --filename_prefix adafruit-circuitpython-featherwing
31+
--library_location .
32+
- cd docs && sphinx-build -E -W -b html . _build/html && cd ..

README.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,31 @@ This is easily achieved by downloading
3030
`the Adafruit library and driver bundle <https://github.com/adafruit/Adafruit_CircuitPython_Bundle>`_ and highly recommended over
3131
installing each one.
3232

33+
Installing from PyPI
34+
--------------------
35+
36+
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
37+
PyPI <https://pypi.org/project/adafruit-circuitpython-featherwing/>`_. To install for current user:
38+
39+
.. code-block:: shell
40+
41+
pip3 install adafruit-circuitpython-featherwing
42+
43+
To install system-wide (this may be required in some cases):
44+
45+
.. code-block:: shell
46+
47+
sudo pip3 install adafruit-circuitpython-featherwing
48+
49+
To install in a virtual environment in your current project:
50+
51+
.. code-block:: shell
52+
53+
mkdir project-name && cd project-name
54+
python3 -m venv .env
55+
source .env/bin/activate
56+
pip3 install adafruit-circuitpython-featherwing
57+
3358
Contributing
3459
============
3560

adafruit_featherwing/joy_featherwing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
__version__ = "0.0.0-auto.0"
3232
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing.git"
3333

34+
from micropython import const
3435
import adafruit_seesaw.seesaw
3536
from adafruit_featherwing import shared
36-
from micropython import const
3737

3838
BUTTON_A = const(1 << 6)
3939
BUTTON_B = const(1 << 7)

adafruit_featherwing/shared.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
* Author(s): Scott Shawcroft
3030
"""
3131

32-
from board import SCL, SDA
32+
import board
3333
import busio
3434

35-
I2C_BUS = busio.I2C(SCL, SDA)
35+
I2C_BUS = busio.I2C(board.SCL, board.SDA)

docs/conf.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
# Uncomment the below if you use native CircuitPython modules such as
1919
# digitalio, micropython and busio. List the modules you use. Without it, the
2020
# autodoc module docs will fail to generate with a warning.
21-
autodoc_mock_imports = ["adafruit_motor", "adafruit_pca9685", "board", "busio", "adafruit_ina219",
22-
"adafruit_seesaw", "micropython"]
21+
autodoc_mock_imports = ["board", "busio"]
2322

2423
intersphinx_mapping = {
2524
'python': ('https://docs.python.org/3.4', None),

requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
Adafruit-Blinka
22
adafruit-circuitpython-busdevice
33
adafruit-circuitpython-register
4+
adafruit-circuitpython-motor
5+
adafruit-circuitpython-pca9685
6+
adafruit-circuitpython-ina219
7+
adafruit-circuitpython-seesaw

setup.py

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
"""A setuptools based setup module.
2+
3+
See:
4+
https://packaging.python.org/en/latest/distributing.html
5+
https://github.com/pypa/sampleproject
6+
"""
7+
8+
# Always prefer setuptools over distutils
9+
from setuptools import setup, find_packages
10+
# To use a consistent encoding
11+
from codecs import open
12+
from os import path
13+
14+
here = path.abspath(path.dirname(__file__))
15+
16+
# Get the long description from the README file
17+
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
18+
long_description = f.read()
19+
20+
setup(
21+
name='adafruit-circuitpython-featherwing',
22+
23+
use_scm_version=True,
24+
setup_requires=['setuptools_scm'],
25+
26+
description='CircuitPython library that provides FeatherWing specific classes for those that '
27+
'require a significant amount of initialization.',
28+
long_description=long_description,
29+
long_description_content_type='text/x-rst',
30+
31+
# The project's main homepage.
32+
url='https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing',
33+
34+
# Author details
35+
author='Adafruit Industries',
36+
author_email='[email protected]',
37+
38+
install_requires=['Adafruit-Blinka', 'adafruit-circuitpython-busdevice',
39+
'adafruit-circuitpython-register', 'adafruit-circuitpython-pca9685',
40+
'adafruit-circuitpython-motor', 'adafruit-circuitpython-ina219',
41+
'adafruit-circuitpython-seesaw'],
42+
43+
# Choose your license
44+
license='MIT',
45+
46+
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
47+
classifiers=[
48+
'Development Status :: 3 - Alpha',
49+
'Intended Audience :: Developers',
50+
'Topic :: Software Development :: Libraries',
51+
'Topic :: System :: Hardware',
52+
'License :: OSI Approved :: MIT License',
53+
'Programming Language :: Python :: 3',
54+
'Programming Language :: Python :: 3.4',
55+
'Programming Language :: Python :: 3.5',
56+
],
57+
58+
# What does your project relate to?
59+
keywords='adafruit motor ina219 pca9685 featherwing joy i2c '
60+
'hardware micropython circuitpython',
61+
62+
# You can just specify the packages manually here if your project is
63+
# simple. Or you can use find_packages().
64+
packages=['adafruit_featherwing'],
65+
)

0 commit comments

Comments
 (0)