From eaa625d6238558ab662cb87ba73d9a5a49418e92 Mon Sep 17 00:00:00 2001 From: Brennen Bearnes Date: Thu, 26 Jul 2018 23:56:25 -0600 Subject: [PATCH] add setup.py & better .gitignore, misc. tweaks for pypi Per instructions at: adafruit/circuitpython#979 --- .gitignore | 10 +++++++- .travis.yml | 34 +++++++++++++-------------- docs/conf.py | 2 -- requirements.txt | 1 + setup.py | 60 ++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 86 insertions(+), 21 deletions(-) create mode 100644 setup.py diff --git a/.gitignore b/.gitignore index 5b5b0c8..cc1a9c8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,12 @@ +*.mpy +.idea +__pycache__ +_build +*.pyc .env build* bundles - +*.DS_Store +.eggs +dist +**/*.egg-info diff --git a/.travis.yml b/.travis.yml index 36ca9b5..523a40c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,31 +1,29 @@ -# This is a common .travis.yml for generating library release zip files for -# CircuitPython library releases using circuitpython-build-tools. -# See https://github.com/adafruit/circuitpython-build-tools for detailed setup -# instructions. - dist: trusty sudo: false language: python python: - - "3.6" - +- '3.6' cache: - pip: true - + pip: true deploy: provider: releases - api_key: $GITHUB_TOKEN + api_key: "$GITHUB_TOKEN" file_glob: true - file: $TRAVIS_BUILD_DIR/bundles/* + file: "$TRAVIS_BUILD_DIR/bundles/*" skip_cleanup: true on: tags: true - +- provider: pypi + user: adafruit-travis + on: + tags: true + password: + secure: vygpUo9Cn8Jn2LqKP1MXzhlusmEoJLB/OBRbni7sI6V0STk04D6/8y3tCvqxhllhCz9CeGTygW8F97TmsgzjXo/jinEbb2wKpCUUa1m6JuJK3tgvg/VaR3OdTFzkbcphP9W00mQs1tjA3L5Kpnj3J3G8X3/Bmq8JKxbMygCyUfCYqNzxv8DptUye/XCG1vMBrJD+Pd+aSgw/OlWmc8rHrg19p8+boVSouOgI/fVFSGCc78iDly6Uzk0nlDtBwh2XH/2AhhgoxLGQZbwblFzJ/kV/NdVdp9BWD1xsY7+2Pi/yN7/7Xk+/ffpYKnGxA6gRcIbjAd6QJxmmJySnz4INABjSiohs1iI5zhqjiQeGevsmGQJx/mcNxExie+DVtjWjkbwEB/ayWDiLrphtVrN2hFzBznlkEPNp+eVECRe1bUnsRJf5rzLs/4VRP+XN4pYjXBFo8Dd/QpjiB8rC579c3IS/frdamC0Za1muHmWw4mXzhCt1gGJznewGBraFM7YRIk/5LeRgJxbLih66glmppHYnoDUkMd7jzcw46OMzmTzJGTXk17mHA/bTKaCUQYjBLOQ9PizJq3nZxan08A7cXOcepNrpodyorpn4sDujYbv3LyLCxe1nswjGknoTDojb+sFO6Yq/LnZyitx6uwv5Lkj3U0qvOj8DQLtkyKS6xIo= install: - - pip install pylint circuitpython-build-tools Sphinx sphinx-rtd-theme - +- pip install -r requirements.txt +- pip install pylint circuitpython-build-tools Sphinx sphinx-rtd-theme script: - - pylint adafruit_dht.py - - ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name examples/*.py) - - circuitpython-build-bundles --filename_prefix adafruit-circuitpython-dht --library_location . - - cd docs && sphinx-build -E -W -b html . _build/html +- pylint adafruit_dht.py +- ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name examples/*.py) +- circuitpython-build-bundles --filename_prefix adafruit-circuitpython-dht --library_location . +- cd docs && sphinx-build -E -W -b html . _build/html && cd .. diff --git a/docs/conf.py b/docs/conf.py index 4cfd5d3..92f399d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -20,8 +20,6 @@ 'Register': ('https://circuitpython.readthedocs.io/projects/register/en/latest/', None), 'CircuitPython': ('https://circuitpython.readthedocs.io/en/latest/', None)} -autodoc_mock_imports = ["pulseio"] - # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] diff --git a/requirements.txt b/requirements.txt index e69de29..edf9394 100644 --- a/requirements.txt +++ b/requirements.txt @@ -0,0 +1 @@ +Adafruit-Blinka diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..2817391 --- /dev/null +++ b/setup.py @@ -0,0 +1,60 @@ +"""A setuptools based setup module. + +See: +https://packaging.python.org/en/latest/distributing.html +https://github.com/pypa/sampleproject +""" + +# Always prefer setuptools over distutils +from setuptools import setup, find_packages +# To use a consistent encoding +from codecs import open +from os import path + +here = path.abspath(path.dirname(__file__)) + +# Get the long description from the README file +with open(path.join(here, 'README.rst'), encoding='utf-8') as f: + long_description = f.read() + +setup( + name='adafruit-circuitpython-dht', + + use_scm_version=True, + setup_requires=['setuptools_scm'], + + description='CircuitPython support for DHT11 and DHT22 type temperature/humidity devices', + long_description=long_description, + long_description_content_type='text/x-rst', + + # The project's main homepage. + url='https://github.com/adafruit/Adafruit_CircuitPython_DHT', + + # Author details + author='Adafruit Industries', + author_email='circuitpython@adafruit.com', + + install_requires=['Adafruit-Blinka'], + + # Choose your license + license='MIT', + + # See https://pypi.python.org/pypi?%3Aaction=list_classifiers + classifiers=[ + 'Development Status :: 3 - Alpha', + 'Intended Audience :: Developers', + 'Topic :: Software Development :: Libraries', + 'Topic :: System :: Hardware', + 'License :: OSI Approved :: MIT License', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + ], + + # What does your project relate to? + keywords='adafruit dht hardware sensors temperature humidity micropython circuitpython', + + # You can just specify the packages manually here if your project is + # simple. Or you can use find_packages(). + py_modules=['adafruit_dht'], +)