Skip to content

Commit 8070fbd

Browse files
authored
Merge pull request #56 from adafruit/auto-pypi-work
Builds release automatically to PyPi
2 parents b0658eb + 64fa940 commit 8070fbd

File tree

3 files changed

+69
-37
lines changed

3 files changed

+69
-37
lines changed

.travis.yml

+23-15
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,30 @@
1-
# .travis.yml for Adafruit IO Python Client Library
21
language: python
32
dist: trusty
43
sudo: required
5-
64
python:
7-
- "3.6"
8-
5+
- '3.6'
96
cache:
10-
pip: true
11-
12-
7+
pip: true
138
install:
14-
- python setup.py install
15-
- pip install pylint Sphinx sphinx-rtd-theme
16-
- pip install .
17-
9+
- python3 setup.py install
10+
- pip3 install pylint Sphinx sphinx-rtd-theme
11+
- pip3 install .
1812
script:
19-
- cd docs && sphinx-build -E -W -b html . _build/html
20-
- cd ..
21-
- cd tests/
22-
- python -m unittest discover
13+
- cd docs && sphinx-build -E -W -b html . _build/html && cd ..
14+
- cd tests/
15+
- python3 -m unittest discover
16+
deploy:
17+
- provider: releases
18+
api_key: "$GITHUB_TOKEN"
19+
file_glob: true
20+
file: "$TRAVIS_BUILD_DIR/bundles/*"
21+
skip_cleanup: true
22+
overwrite: true
23+
on:
24+
tags: true
25+
- provider: pypi
26+
user: adafruit-travis
27+
on:
28+
tags: true
29+
password:
30+
secure: WYAvV+71bL0EjUV2MMmIuf/P0RNLBUGiHcjFZnvRhZriOP7MPSXoePG31k309mWE/0e26gxPWdZH/zpWEm5Vzb2RbGGvTypjD9u/c5HJqcLohVy9mPCqgvkJNQi+Sqe0u4XsMHMaueZd8vry+MLH5+h6Py7fjx/4MVZKHLxHdMI=

docs/conf.py

+4-10
Original file line numberDiff line numberDiff line change
@@ -16,12 +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 = ["digitalio", "busio"]
24-
2519

2620
intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None),'CircuitPython': ('https://circuitpython.readthedocs.io/en/latest/', None)}
2721

@@ -35,17 +29,17 @@
3529

3630
# General information about the project.
3731
project = u'io-client-python'
38-
copyright = u'2018 Tony DiCola, Justin Cooper, Adam Bachman, Todd Treece, Brent Rubell'
39-
author = u'Tony DiCola, Justin Cooper, Adam Bachman, Todd Treece, Brent Rubell'
32+
copyright = u'2018 Adafruit Industries'
33+
author = u'Adafruit Industries'
4034

4135
# The version info for the project you're documenting, acts as replacement for
4236
# |version| and |release|, also used in various other places throughout the
4337
# built documents.
4438
#
4539
# The short X.Y version.
46-
version = u'2.0'
40+
version = u'2.0.1'
4741
# The full version, including alpha/beta/rc tags.
48-
release = u'2.0'
42+
release = u'2.0.1'
4943

5044
# The language for content autogenerated by Sphinx. Refer to documentation
5145
# for a list of supported languages.

setup.py

+42-12
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
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+
18
from ez_setup import use_setuptools
29
use_setuptools()
310
from setuptools import setup, find_packages
11+
# To use a consistent encoding
12+
from codecs import open
13+
from os import path
414
import re
515

16+
17+
# Get the version string from _version.py
618
verstrline = open('Adafruit_IO/_version.py', "rt").read()
719
VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]"
820
mo = re.search(VSRE, verstrline, re.M)
@@ -12,31 +24,49 @@
1224
raise RuntimeError("Unable to find version string in %s." % (VERSIONFILE,))
1325
print('version: ', verstr)
1426

27+
# Get the long description from the README file
28+
here = path.abspath(path.dirname(__file__))
29+
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
30+
long_description = f.read()
31+
1532
classifiers = ['Development Status :: 5 - Production/Stable',
1633
'Operating System :: POSIX :: Linux',
1734
'Operating System :: Microsoft :: Windows',
1835
'Operating System :: MacOS',
1936
'License :: OSI Approved :: MIT License',
2037
'Intended Audience :: Developers',
21-
'Programming Language :: Python :: 3.4',
2238
'Programming Language :: Python :: 3',
23-
'Topic :: Software Development',
39+
'Programming Language :: Python :: 3.4',
40+
'Programming Language :: Python :: 3.5',
2441
'Topic :: Home Automation',
25-
'Topic :: System :: Hardware']
42+
'Topic :: Software Development',
43+
'Topic :: Syste m :: Hardware']
2644

2745
setup(
2846
name = 'adafruit-io',
29-
version = verstr,
47+
use_scm_version = True,
48+
setup_requires = ['setuptools_scm'],
49+
50+
description = 'Python client library for Adafruit IO (http://io.adafruit.com/).',
51+
long_description = open('README.rst').read(),
52+
long_description_content_type='text/x-rst',
53+
54+
url = 'https://github.com/adafruit/io-client-python',
55+
3056
author = 'Adafruit Industries',
3157
author_email = '[email protected]',
32-
packages = ['Adafruit_IO'],
33-
py_modules = ['ez_setup'],
34-
url = 'https://github.com/adafruit/io-client-python',
58+
3559
license = 'MIT',
36-
keywords = 'Adafruit IO',
37-
classifiers = classifiers,
60+
61+
62+
version = verstr,
63+
install_requires = ["requests", "paho-mqtt"],
3864
python_requires = ">=3.4.0",
39-
description = 'Python client library for Adafruit IO (http://io.adafruit.com/).',
40-
long_description = open('README.rst').read(),
41-
install_requires = ["requests", "paho-mqtt"]
65+
66+
67+
68+
packages = ['Adafruit_IO'],
69+
py_modules = ['ez_setup'],
70+
keywords = 'adafruitio io python circuitpython raspberrypi hardware MQTT',
71+
classifiers = classifiers
4272
)

0 commit comments

Comments
 (0)