Skip to content

Commit 89927db

Browse files
committed
add setup.py, add pypi to .travis.yml, misc. tweaks for pypi
Per instructions at: adafruit/circuitpython#979
1 parent 49acea9 commit 89927db

File tree

4 files changed

+84
-27
lines changed

4 files changed

+84
-27
lines changed

.travis.yml

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,29 @@ dist: trusty
77
sudo: false
88
language: python
99
python:
10-
- "3.6"
11-
10+
- '3.6'
1211
cache:
13-
pip: true
14-
12+
pip: true
1513
deploy:
16-
provider: releases
17-
api_key: $GITHUB_TOKEN
18-
file_glob: true
19-
file: $TRAVIS_BUILD_DIR/bundles/*
20-
skip_cleanup: true
21-
overwrite: true
22-
on:
23-
tags: true
24-
14+
- provider: releases
15+
api_key: "$GITHUB_TOKEN"
16+
file_glob: true
17+
file: "$TRAVIS_BUILD_DIR/bundles/*"
18+
skip_cleanup: true
19+
overwrite: true
20+
on:
21+
tags: true
22+
- provider: pypi
23+
user: adafruit-travis
24+
on:
25+
tags: true
26+
password:
27+
secure: 3in/QXIrXq6l2QJRYjUnufB6rYnZVptU9VeKsWsLSLty3BYnxbN8PEXWDu1h0q7W1s/aHcMrB25yZTRXnwAvYxrOsmA6ZYmmIX2CcT/bKbNWE+kKwl90BA48Ip8Awxc/jZOJ/gDCtbqE9mf8AFVd5zXzJUbgE8p6FSCurJLkJevBkWUcLws1KKEN0+kMu5+z8Ghi/HPacQ0Uvr2fNvSbGI0/hmPlJfZuhdp1zdo3R5cS2E4IiIO6UPDUINVMzQOBKcngZ14NIGUjSqaff1aP4elxY7qAndl3qMgoLq0EfVpxy2trsTvtSkpTqfSZamMZiZWF0T/oD7RkOllf2j3F6b37ZTZWhldZuLzDApLFy1aVVEme+yoPnWNPbYaREUkyhSmeA2bOAsoN7Mn5NG9HZOujrS/m5sJi8PKyRjbKgryt5uRrkKpPdJW8gUun5CoPEtNEQ6NT3vfI7DhjkiTevVxXkDHf0ENNtmhbla/3fYOB2jkJDYLOMyw2UTdn232ORlVHF0vVVjUZfJxrIUIb8L8XZ/dxXikORsY3Z0HYD8t6GDoAmvLr7LMw1pv3XxW6eV14Hc9SXoZdWwYTHYPQtT899pBrc7TqtLHh8OoQxMSFSfdiH7jfjkKB2VFUV7TNysxjg94ip9dC4R1tS49UHurP8CIBeMOyXFmlgiql5xU=
2528
install:
26-
- pip install pylint circuitpython-build-tools Sphinx sphinx-rtd-theme
27-
29+
- pip install -r requirements.txt
30+
- pip install pylint circuitpython-build-tools Sphinx sphinx-rtd-theme
2831
script:
29-
- pylint adafruit_am2320.py
30-
- ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name,bad-whitespace examples/*.py)
31-
- circuitpython-build-bundles --filename_prefix adafruit-circuitpython-am2320 --library_location .
32-
- cd docs && sphinx-build -E -W -b html . _build/html
32+
- pylint adafruit_am2320.py
33+
- ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name,bad-whitespace examples/*.py)
34+
- circuitpython-build-bundles --filename_prefix adafruit-circuitpython-am2320 --library_location .
35+
- cd docs && sphinx-build -E -W -b html . _build/html && cd ..

docs/conf.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,6 @@
1616
'sphinx.ext.todo',
1717
]
1818

19-
# TODO: Please Read!
20-
# Uncomment the below if you use native CircuitPython modules such as
21-
# digitalio, micropython and busio. List the modules you use. Without it, the
22-
# autodoc module docs will fail to generate with a warning.
23-
autodoc_mock_imports = ["adafruit_bus_device", "micropython"]
24-
25-
2619
intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None),'CircuitPython': ('https://circuitpython.readthedocs.io/en/latest/', None)}
2720

2821
# Add any paths that contain templates here, relative to this directory.

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
adafruit-circuitpython-bus-device
1+
Adafruit-Blinka
2+
adafruit-circuitpython-busdevice

setup.py

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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-am2320',
22+
23+
use_scm_version=True,
24+
setup_requires=['setuptools_scm'],
25+
26+
description='CircuitPython driver for the AM2320 temperature and humidity sensor.',
27+
long_description=long_description,
28+
long_description_content_type='text/x-rst',
29+
30+
# The project's main homepage.
31+
url='https://github.com/adafruit/Adafruit_CircuitPython_AM2320',
32+
33+
# Author details
34+
author='Adafruit Industries',
35+
author_email='[email protected]',
36+
37+
install_requires=['Adafruit-Blinka', 'adafruit-circuitpython-busdevice'],
38+
39+
# Choose your license
40+
license='MIT',
41+
42+
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
43+
classifiers=[
44+
'Development Status :: 3 - Alpha',
45+
'Intended Audience :: Developers',
46+
'Topic :: Software Development :: Libraries',
47+
'Topic :: System :: Hardware',
48+
'License :: OSI Approved :: MIT License',
49+
'Programming Language :: Python :: 3',
50+
'Programming Language :: Python :: 3.4',
51+
'Programming Language :: Python :: 3.5',
52+
],
53+
54+
# What does your project relate to?
55+
keywords='adafruit am2320 temperature humidity hardware micropython circuitpython',
56+
57+
# You can just specify the packages manually here if your project is
58+
# simple. Or you can use find_packages().
59+
py_modules=['adafruit_am2320'],
60+
)

0 commit comments

Comments
 (0)