From: Phil Howard Date: Thu, 6 Jun 2019 13:26:49 +0000 (+0100) Subject: Synced with bootstrap X-Git-Url: https://zdv2.bktei.com/gitweb/EVA-2020-02-2.git/commitdiff_plain/3547bf15f463ff469e6e2e4ea6940b3066cb41da Synced with bootstrap --- diff --git a/README.md b/README.md index 288aa46..afdf462 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,19 @@ -# {{TITLE}} +# Enviro pHAT Plus -[![Build Status](https://travis-ci.com/pimoroni/{{LIBNAME}}-python.svg?branch=master)](https://travis-ci.com/pimoroni/{{LIBNAME}}-python) -[![Coverage Status](https://coveralls.io/repos/github/pimoroni/{{LIBNAME}}-python/badge.svg?branch=master)](https://coveralls.io/github/pimoroni/{{LIBNAME}}-python?branch=master) -[![PyPi Package](https://img.shields.io/pypi/v/{{LIBNAME}}.svg)](https://pypi.python.org/pypi/{{LIBNAME}}) -[![Python Versions](https://img.shields.io/pypi/pyversions/{{LIBNAME}}.svg)](https://pypi.python.org/pypi/{{LIBNAME}}) +[![Build Status](https://travis-ci.com/pimoroni/envirophatplus-python.svg?branch=master)](https://travis-ci.com/pimoroni/envirophatplus-python) +[![Coverage Status](https://coveralls.io/repos/github/pimoroni/envirophatplus-python/badge.svg?branch=master)](https://coveralls.io/github/pimoroni/envirophatplus-python?branch=master) +[![PyPi Package](https://img.shields.io/pypi/v/envirophatplus.svg)](https://pypi.python.org/pypi/envirophatplus) +[![Python Versions](https://img.shields.io/pypi/pyversions/envirophatplus.svg)](https://pypi.python.org/pypi/envirophatplus) # Installing Stable library from PyPi: -* Just run `sudo pip install {{LIBNAME}}` +* Just run `sudo pip install envirophatplus` Latest/development library from GitHub: -* `git clone https://github.com/pimoroni/{{LIBNAME}}-python` -* `cd {{LIBNAME}}-python` +* `git clone https://github.com/pimoroni/envirophatplus-python` +* `cd envirophatplus-python` * `sudo ./install.sh` diff --git a/_bootstrap.md b/_bootstrap.md deleted file mode 100644 index e094de3..0000000 --- a/_bootstrap.md +++ /dev/null @@ -1,75 +0,0 @@ -* Python Library - library/name/__init__.py -* At least *one* test - library/tests/test_setup.py -* Examples - -# In Detail - -To get started, copy the contents of this repository (excluding the .git directory) and run `_bootstrap.sh` to highlight substitutions you need to make. - -Be careful to copy *all* files, including those starting with a . such as `.travis.yml`. - -A Makefile is provided to automate some tests, checks and package building. You should use it! - -## Library - -### Structure - -Libraries should be singleton if they pertain to a HAT or pHAT and class-based if they are for breakouts with selectable addresses. - -A singleton library would work like this: - -``` -import library - -library.do_something() -``` - -Whereas a class-based library requires an instance of its class: - -``` -import library - -device = library.Library() - -device.do_something() -``` - -### Linting - -You should ensure you either run `flake8` while writing the library, or use an IDE/Editor with linting. - -All libraries (and example code) should stick to PEP8 style guides, although you can ignore long line warnings (E501) if you feel they're unwarranted. - -### Testing - -At least one test script should be used to prevent obvious errors and omissions from creeping into the library. - -You should use `tox` to run the test scripts: - -``` -sudo pip install tox -cd library/ -tox -``` - -## Examples - -Examples should use hyphens and short, descriptive names, ie: `rainbow-larson.py` - -Examples should include a `print()` front-matter introducing them, ie: - -``` -print("""rainbow-larson.py - Display a larson scanning rainbow - -Press Ctrl+C to exit. - -""") -``` - -# Deployment - -Before deploying you should `make python-testdeploy` and verify that the package looks good and is installable from test PyPi. - -You should also `make check` to catch common errors, including mismatched version numbers, trailing whitespace and DOS line-endings. - -Subsequent to deployment you should `git tag -a "vX.X.X" -m "Version X.X.X"` and `git push origin master --follow-tags` to tag a release on GitHub that matches the deployed code. diff --git a/_bootstrap.sh b/_bootstrap.sh deleted file mode 100755 index 8b88e7d..0000000 --- a/_bootstrap.sh +++ /dev/null @@ -1,5 +0,0 @@ -printf "\nOutstanding substitutions:\n" -grep -Irn --color "{{[A-Z:]*}}" - -printf "\nOutstanding directory renames:\n" -find . -regex ".*{{[A-Z]*}}" diff --git a/_bootstrap_remotes.sh b/_bootstrap_remotes.sh deleted file mode 100755 index c29ba5f..0000000 --- a/_bootstrap_remotes.sh +++ /dev/null @@ -1,3 +0,0 @@ -git remote rename origin boilerplate -git remote set-url --push boilerplate no_push -git remote add origin $1 diff --git a/library/.coveragerc b/library/.coveragerc index dfa463a..ee01f7f 100644 --- a/library/.coveragerc +++ b/library/.coveragerc @@ -1,4 +1,4 @@ [run] -source = {{LIBNAME}} +source = envirophatplus omit = .tox/* diff --git a/library/MANIFEST.in b/library/MANIFEST.in index 4f72d67..c2d4aa6 100644 --- a/library/MANIFEST.in +++ b/library/MANIFEST.in @@ -2,4 +2,4 @@ include CHANGELOG.txt include LICENSE.txt include README.rst include setup.py -recursive-include {{LIBNAME}} *.py +recursive-include envirophatplus *.py diff --git a/library/README.rst b/library/README.rst new file mode 100644 index 0000000..6e2d507 --- /dev/null +++ b/library/README.rst @@ -0,0 +1,26 @@ +Enviro pHAT Plus +================ + +|Build Status| |Coverage Status| |PyPi Package| |Python Versions| + +Installing +========== + +Stable library from PyPi: + +- Just run ``sudo pip install envirophatplus`` + +Latest/development library from GitHub: + +- ``git clone https://github.com/pimoroni/envirophatplus-python`` +- ``cd envirophatplus-python`` +- ``sudo ./install.sh`` + +.. |Build Status| image:: https://travis-ci.com/pimoroni/envirophatplus-python.svg?branch=master + :target: https://travis-ci.com/pimoroni/envirophatplus-python +.. |Coverage Status| image:: https://coveralls.io/repos/github/pimoroni/envirophatplus-python/badge.svg?branch=master + :target: https://coveralls.io/github/pimoroni/envirophatplus-python?branch=master +.. |PyPi Package| image:: https://img.shields.io/pypi/v/envirophatplus.svg + :target: https://pypi.python.org/pypi/envirophatplus +.. |Python Versions| image:: https://img.shields.io/pypi/pyversions/envirophatplus.svg + :target: https://pypi.python.org/pypi/envirophatplus diff --git a/library/{{LIBNAME}}/__init__.py b/library/envirophatplus/__init__.py similarity index 100% rename from library/{{LIBNAME}}/__init__.py rename to library/envirophatplus/__init__.py diff --git a/library/setup.py b/library/setup.py index b211db7..3fdea5a 100755 --- a/library/setup.py +++ b/library/setup.py @@ -38,17 +38,17 @@ classifiers = ['Development Status :: 4 - Beta', 'Topic :: System :: Hardware'] setup( - name='{{LIBNAME}}', + name='envirophatplus', version='0.0.1', author='Philip Howard', author_email='phil@pimoroni.com', - description="""{{DESCRIPTION}}""", + description="""Enviro pHAT Plus environmental monitoring add-on for Raspberry Pi""", long_description=open('README.rst').read() + '\n' + open('CHANGELOG.txt').read(), license='MIT', keywords='Raspberry Pi', url='http://www.pimoroni.com', - project_urls={'GitHub': 'https://www.github.com/pimoroni/{{LIBNAME}}-python'}, + project_urls={'GitHub': 'https://www.github.com/pimoroni/envirophatplus-python'}, classifiers=classifiers, - packages=['{{LIBNAME}}'], - install_requires=[] + packages=['envirophatplus'], + install_requires=['pms5003', 'ltr559', 'st7735'] )