Skip to content

Commit f39188f

Browse files
committed
add setup.py, add pypi to travis.yml, misc. tweaks for pypi
Changes per instructions here: adafruit/circuitpython#979 ...builds locally. Let's see what Travis thinks.
1 parent 2b16d82 commit f39188f

File tree

4 files changed

+84
-29
lines changed

4 files changed

+84
-29
lines changed

.travis.yml

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,28 @@
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
18-
file_glob: true
19-
file: $TRAVIS_BUILD_DIR/bundles/*
20-
skip_cleanup: true
21-
on:
22-
tags: true
23-
9+
- provider: releases
10+
api_key: "$GITHUB_TOKEN"
11+
file_glob: true
12+
file: "$TRAVIS_BUILD_DIR/bundles/*"
13+
skip_cleanup: true
14+
on:
15+
tags: true
16+
- provider: pypi
17+
user: adafruit-travis
18+
password:
19+
secure: QCVXg2x28R7W6g+YvewEM0XamfyNVUal0CvNTFgjrnqj4K9Yd9gd8uKXM9cmFxD54y2Uvw8vWyNwQ4IsVZOuuTTohzc3hIlQhSEWhYZTt5i/JQISQSph/Q/dSn0/rb7n2/utfj/g1hB7cQlAtkecISrtIF7wOJacrh11z5/Ay99kcpc60Y7YFjZTbx02g8NnM0g6Cg92fEdRLr2UtwloFw1C0+nQxdb9vS7xj3IWrtfopQ3LRVsLTGocctj5u6OPgkh+FZma+NCIseONqpYX4PYRrRZJRQ4g+SZ+6tFb6zVOHsIAJ0Z6PdLMZmUeNGb42mTfHxPFWaTtPXi5/bgsOLfuL7IMpkirrqQFyppvqi7bqBYC5dCDGguEvzwHZusK4h8SAXiLJL4hZVkzNQ4JJN3JQSvAaF7nv8LIHGNpPsFOF8sd5gndMHUOBZx+lJ6wHqk3dxrhfehKKyv/xZ8Tl1ot65E8I3QBrJfREDbSgTfyetEFMPQLOUkZFcag3FCjiLVfR2AxxxaSPMcS0eUDefhYHm78ukZi8EQRiM/5Pnqv7tnsFg4+ua4c5Hw2Tck5htNAHEMMJ94PxvFSGhbZ8ujjSjiSPePfAVoJZo1617rL7cw54LeaOe6zU5fJiWEMVDeonCFK9yZ9tmqxpEnEf+wwK4bfTI8TycA9e5oNY0M=
2420
install:
25-
- pip install pylint circuitpython-build-tools Sphinx sphinx-rtd-theme
26-
21+
- pip install -r requirements.txt
22+
- pip install pylint circuitpython-build-tools Sphinx sphinx-rtd-theme
2723
script:
28-
- pylint adafruit_ads1x15/*.py
29-
- ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name examples/*.py)
30-
- circuitpython-build-bundles --filename_prefix adafruit-circuitpython-ads1x15 --library_location .
31-
- cd docs && sphinx-build -E -W -b html . _build/html
24+
- pylint adafruit_ads1x15/*.py
25+
- ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name examples/*.py)
26+
- circuitpython-build-bundles --filename_prefix adafruit-circuitpython-ads1x15 --library_location
27+
.
28+
- cd docs && sphinx-build -E -W -b html . _build/html && cd ..

docs/conf.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@
1515
'sphinx.ext.viewcode',
1616
]
1717

18-
# Uncomment the below if you use native CircuitPython modules such as
19-
# digitalio, micropython and busio. List the modules you use. Without it, the
20-
# autodoc module docs will fail to generate with a warning.
21-
autodoc_mock_imports = ["adafruit_bus_device", "micropython"]
22-
2318
intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None),'BusDevice': ('https://circuitpython.readthedocs.io/projects/busdevice/en/latest/', None),'Register': ('https://circuitpython.readthedocs.io/projects/register/en/latest/', None),'CircuitPython': ('https://circuitpython.readthedocs.io/en/latest/', None)}
2419

2520
# 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: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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+
from setuptools import setup, find_packages
9+
# To use a consistent encoding
10+
from codecs import open
11+
from os import path
12+
13+
here = path.abspath(path.dirname(__file__))
14+
15+
# Get the long description from the README file
16+
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
17+
long_description = f.read()
18+
19+
setup(
20+
name='adafruit-circuitpython-ads1x15',
21+
22+
use_scm_version=True,
23+
setup_requires=['setuptools_scm'],
24+
25+
description='CircuitPython library for controlling an ADS1x15 ADC.',
26+
long_description=long_description,
27+
long_description_content_type='text/x-rst',
28+
29+
# The project's main homepage.
30+
url='https://github.com/adafruit/Adafruit_CircuitPython_ADS1x15',
31+
32+
# Author details
33+
author='Adafruit Industries',
34+
author_email='[email protected]',
35+
36+
install_requires=[
37+
'Adafruit-Blinka',
38+
'adafruit-circuitpython-busdevice'
39+
],
40+
41+
# Choose your license
42+
license='MIT',
43+
44+
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
45+
classifiers=[
46+
'Development Status :: 3 - Alpha',
47+
'Intended Audience :: Developers',
48+
'Topic :: Software Development :: Libraries',
49+
'Topic :: System :: Hardware',
50+
'License :: OSI Approved :: MIT License',
51+
'Programming Language :: Python :: 3',
52+
'Programming Language :: Python :: 3.4',
53+
'Programming Language :: Python :: 3.5',
54+
],
55+
56+
# What does your project relate to?
57+
keywords='adafruit ads1x115 adc hardware micropython circuitpython',
58+
59+
# You can just specify the packages manually here if your project is
60+
# simple. Or you can use find_packages().
61+
packages=['adafruit_ads1x15'],
62+
)

0 commit comments

Comments
 (0)