From 0bf4ee62de4e38f6664acd361f529159153c598f Mon Sep 17 00:00:00 2001 From: Kattni Rembor Date: Wed, 1 Aug 2018 15:56:18 -0400 Subject: [PATCH 1/2] PyPi setup. --- .gitignore | 9 +++++++- .travis.yml | 37 ++++++++++++++++---------------- docs/conf.py | 2 +- setup.py | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 88 insertions(+), 20 deletions(-) create mode 100644 setup.py diff --git a/.gitignore b/.gitignore index fa20fae..55f127b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,12 @@ -.DS_Store *.mpy +.idea +__pycache__ +_build +*.pyc .env build* bundles +*.DS_Store +.eggs +dist +**/*.egg-info \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 721b737..015d9b7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,32 +1,33 @@ -# 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 overwrite: true on: tags: true - +- provider: pypi + user: adafruit-travis + on: + tags: true + password: + secure: sWg7JBkDIM8+S4h6SQhNJ7rRX5BjrtGN+sSIX+O6QwMD+/ZKfKI2SKWtH45C6DOpUHZft40Pr1GY4PTqopks+PxFUr7Z/j/FteaMGYLGoSaYtvI7A5xgzD6dh5Myj8t+6rx+2IflztU72Xs7FckZQP1NngGLqbnG5FmOEjPaK2on+zfxYr6ue0zoghAKVzHpw4kFx6snMnjw/Zuky/a8R0rgD7sQ/lOGaVRZGq0sk7cMddifR+hHctKsnE5MDdkadcsAp4E65xPQfLJWjSuQm8GCOMxXy2Uxu2QaPak5ySRjqMKXAweZAG6ERIq5j16Hr3NtfAObrIkYICp7qabbbTV6WsY+Y4E275hRmCLAc+bN0z5xY5SMg40FFq38t1CCvdAmkLizmJnD6cxziPEPt7o5jekTkijLdFPDPcEuhq2QIM0JMTS/EwUbN9BuCKs7VRO9TQ0JPcSaFL2Xh8HTtsV3qrfOxvoReTLHGGZlz7A1W2NWfzI2tVGEcbh0sBDAEauutK6+vOQO3hvI/0Vq/Lek5yloJ2shksfrwLvWRZJDlSi5bSmQTLzP0BfPFwZc1D3D7KJOtHe3IqY5KCwbYGAn/+j/MNitULw+F/nspYYYANd37gFKWuslpIQgUfaLLU8gM70+6Zj+E/fiOzl18FVK8KNhxTBIsUMyIpoZ73Y= 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 +- pip install --force-reinstall pylint==1.9.2 script: - - pylint adafruit_lis3dh.py - - ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name examples/*.py) - - circuitpython-build-bundles --filename_prefix adafruit-circuitpython-lis3dh --library_location . - - cd docs && sphinx-build -E -W -b html . _build/html +- pylint adafruit_lis3dh.py +- ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name examples/*.py) +- circuitpython-build-bundles --filename_prefix adafruit-circuitpython-lis3dh --library_location + . +- cd docs && sphinx-build -E -W -b - cd docs && sphinx-build -E -W -b html . _build/html && cd .. +html . _build/html diff --git a/docs/conf.py b/docs/conf.py index 82431c4..e50d147 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -18,7 +18,7 @@ # Uncomment the below if you use native CircuitPython modules such as # digitalio, micropython and busio. List the modules you use. Without it, the # autodoc module docs will fail to generate with a warning. -autodoc_mock_imports = ["digitalio", "micropython", "ucollections"] +# autodoc_mock_imports = ["digitalio", "micropython", "ucollections"] intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None),'BusDevice': ('https://circuitpython.readthedocs.io/projects/busdevice/en/latest/', None),'CircuitPython': ('https://circuitpython.readthedocs.io/en/latest/', None)} diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..a2ff987 --- /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-lis3dh', + + use_scm_version=True, + setup_requires=['setuptools_scm'], + + description='CircuitPython library for LIS3DH accelerometer.', + long_description=long_description, + long_description_content_type='text/x-rst', + + # The project's main homepage. + url='https://github.com/adafruit/Adafruit_CircuitPython_LIS3DH', + + # 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 accelerometer lis3dh acceleration hardware micropython circuitpython', + + # You can just specify the packages manually here if your project is + # simple. Or you can use find_packages(). + py_modules=['adafruit_lis3dh'], +) \ No newline at end of file From 86851d45d593fcd73bf2f74e8461286b8331f0b1 Mon Sep 17 00:00:00 2001 From: Kattni Rembor Date: Wed, 1 Aug 2018 16:16:27 -0400 Subject: [PATCH 2/2] fixed typo --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 015d9b7..330653e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,5 +29,4 @@ script: - ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name examples/*.py) - circuitpython-build-bundles --filename_prefix adafruit-circuitpython-lis3dh --library_location . -- cd docs && sphinx-build -E -W -b - cd docs && sphinx-build -E -W -b html . _build/html && cd .. -html . _build/html +- cd docs && sphinx-build -E -W -b html . _build/html && cd ..