Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 651e1c2
Showing
18 changed files
with
322 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
build/ | ||
_build/ | ||
*.o | ||
*.so | ||
*.a | ||
*.py[cod] | ||
*.egg-info | ||
dist/ | ||
__pycache__ | ||
.DS_Store | ||
*.deb | ||
*.dsc | ||
*.build | ||
*.changes | ||
*.orig.* | ||
packaging/*tar.xz | ||
library/debian/ | ||
.coverage | ||
.pytest_cache | ||
.tox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
linters: | ||
flake8: | ||
python: 3 | ||
max-line-length: 160 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
language: python | ||
sudo: false | ||
cache: pip | ||
|
||
git: | ||
submodules: true | ||
|
||
matrix: | ||
include: | ||
- python: "2.7" | ||
env: TOXENV=py27 | ||
- python: "3.5" | ||
env: TOXENV=py35 | ||
- python: "2.7" | ||
env: TOXENV=py27 | ||
|
||
install: | ||
- pip install --ignore-installed --upgrade setuptools pip tox coveralls | ||
|
||
script: | ||
- cd library | ||
- tox -vv | ||
|
||
after_success: if [ "$TOXENV" == "py35" ]; then coveralls; fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2018 Pimoroni Ltd. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# {{TITLE}} | ||
|
||
[![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) | ||
[![Python Versions](https://img.shields.io/pypi/pyversions/{{LIBNAME}}.svg)](https://pypi.python.org/pypi/{{LIBNAME}}-python) | ||
|
||
# Installing | ||
|
||
Stable library from PyPi: | ||
|
||
* Just run `sudo pip install {{LIBNAME}}` | ||
|
||
Latest/development library from GitHub: | ||
|
||
* `git clone https://github.com/pimoroni/{{LIBNAME}}-python` | ||
* `cd {{LIBNAME}}-python` | ||
* `sudo ./install.sh` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
printf "\nOutstanding substitutions:\n" | ||
grep -Irn --color "{{[A-Z:]*}}" | ||
|
||
printf "\nOutstanding directory renames:\n" | ||
find . -regex ".*{{[A-Z]*}}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
printf "{{LIBNAME:UC}} Python Library: Installer\n\n" | ||
|
||
if [ $(id -u) -ne 0 ]; then | ||
printf "Script must be run as root. Try 'sudo ./install.sh'\n" | ||
exit 1 | ||
fi | ||
|
||
cd library | ||
|
||
printf "Installing for Python 2..\n" | ||
python setup.py install | ||
|
||
if [ -f "/usr/bin/python3" ]; then | ||
printf "Installing for Python 3..\n" | ||
python3 setup.py install | ||
fi | ||
|
||
cd .. | ||
|
||
printf "Done!\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[run] | ||
source = {{LIBNAME}} | ||
omit = | ||
.tox/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
0.0.1 | ||
----- | ||
|
||
* Initial Release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2018 Pimoroni Ltd. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
include CHANGELOG.txt | ||
include LICENSE.txt | ||
include README.rst | ||
include setup.py | ||
recursive-include {{LIBNAME}} *.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[flake8] | ||
exclude = | ||
.tox, | ||
.eggs, | ||
.git, | ||
__pycache__, | ||
build, | ||
dist | ||
ignore = | ||
E501 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/usr/bin/env python | ||
|
||
""" | ||
Copyright (c) 2016 Pimoroni | ||
Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
this software and associated documentation files (the "Software"), to deal in | ||
the Software without restriction, including without limitation the rights to | ||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies | ||
of the Software, and to permit persons to whom the Software is furnished to do | ||
so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
""" | ||
|
||
try: | ||
from setuptools import setup | ||
except ImportError: | ||
from distutils.core import setup | ||
|
||
classifiers = ['Development Status :: 4 - Beta', | ||
'Operating System :: POSIX :: Linux', | ||
'License :: OSI Approved :: MIT License', | ||
'Intended Audience :: Developers', | ||
'Programming Language :: Python :: 2.6', | ||
'Programming Language :: Python :: 2.7', | ||
'Programming Language :: Python :: 3', | ||
'Topic :: Software Development', | ||
'Topic :: System :: Hardware'] | ||
|
||
setup( | ||
name='{{LIBNAME}}', | ||
version='0.0.1', | ||
author='Philip Howard', | ||
author_email='phil@pimoroni.com', | ||
description="""{{DESCRIPTION}}""", | ||
long_description=open('README.rst').read() + '\n' + open('CHANGELOG.txt').read(), | ||
license='MIT', | ||
keywords='Raspberry Pi', | ||
url='http://www.pimoroni.com', | ||
classifiers=classifiers, | ||
packages=['{{LIBNAME}}'], | ||
install_requires=[] | ||
) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[tox] | ||
envlist = py{27,35},qa | ||
skip_missing_interpreters = True | ||
|
||
[testenv] | ||
commands = | ||
python setup.py install | ||
coverage run -m py.test -v -r wsx | ||
coverage report | ||
deps = | ||
mock | ||
pytest>=3.1 | ||
pytest-cov | ||
|
||
[testenv:qa] | ||
commands = | ||
flake8 --ignore E501 | ||
rstcheck README.rst | ||
deps = | ||
flake8 | ||
rstcheck |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
__version__ = '0.0.1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
PACKAGE="{{LIBNAME}}" | ||
|
||
printf "{{LIBNAME:UC}} Python Library: Uninstaller\n\n" | ||
|
||
if [ $(id -u) -ne 0 ]; then | ||
printf "Script must be run as root. Try 'sudo ./uninstall.sh'\n" | ||
exit 1 | ||
fi | ||
|
||
cd library | ||
|
||
printf "Unnstalling for Python 2..\n" | ||
pip uninstall $PACKAGE | ||
|
||
if [ -f "/usr/bin/pip3" ]; then | ||
printf "Uninstalling for Python 3..\n" | ||
pip3 uninstall $PACKAGE | ||
fi | ||
|
||
cd .. | ||
|
||
printf "Done!\n" |