Skip to content

Commit

Permalink
Synced with bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
Gadgetoid committed Jun 6, 2019
2 parents 4e40239 + 4a1c675 commit 86c38d1
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 13 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ matrix:
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
Expand All @@ -22,3 +20,6 @@ script:
- tox -vv

after_success: if [ "$TOXENV" == "py35" ]; then coveralls; fi

notifications:
email: false
14 changes: 10 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
LIBRARY_VERSION=`cat library/setup.py | grep version | awk -F"'" '{print $$2}'`
LIBRARY_NAME=`cat library/setup.py | grep name | awk -F"'" '{print $$2}'`
LIBRARY_VERSION=$(shell cat library/setup.py | grep version | awk -F"'" '{print $$2}')
LIBRARY_NAME=$(shell cat library/setup.py | grep name | awk -F"'" '{print $$2}')

.PHONY: usage install uninstall
usage:
@echo "Library: ${LIBRARY_NAME}"
@echo "Version: ${LIBRARY_VERSION}\n"
@echo "Usage: make <target>, where target is one of:\n"
@echo "install: install the library locally from source"
@echo "uninstall: uninstall the local library"
Expand All @@ -13,6 +15,7 @@ usage:
@echo "python-clean: clean python build and dist directories"
@echo "python-dist: build all python distribution files"
@echo "python-testdeploy: build all and deploy to test PyPi"
@echo "tag: tag the repository with the current version"

install:
./install.sh
Expand All @@ -22,14 +25,17 @@ uninstall:

check:
@echo "Checking for trailing whitespace"
@! grep -IUrn --color "[[:blank:]]$$" --exclude-dir=.tox --exclude-dir=.git --exclude=PKG-INFO
@! grep -IUrn --color "[[:blank:]]$$" --exclude-dir=sphinx --exclude-dir=.tox --exclude-dir=.git --exclude=PKG-INFO
@echo "Checking for DOS line-endings"
@! grep -IUrn --color "" --exclude-dir=.tox --exclude-dir=.git --exclude=Makefile
@! grep -IUrn --color "" --exclude-dir=sphinx --exclude-dir=.tox --exclude-dir=.git --exclude=Makefile
@echo "Checking library/CHANGELOG.txt"
@cat library/CHANGELOG.txt | grep ^${LIBRARY_VERSION}
@echo "Checking library/${LIBRARY_NAME}/__init__.py"
@cat library/${LIBRARY_NAME}/__init__.py | grep "^__version__ = '${LIBRARY_VERSION}'"

tag:
git tag -a "v${LIBRARY_VERSION}" -m "Version ${LIBRARY_VERSION}"

python-readme: library/README.rst

python-license: library/LICENSE.txt
Expand Down
5 changes: 4 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/bash

printf "KEYBOW Python Library: Installer\n\n"
LIBRARY_VERSION=`cat library/setup.py | grep version | awk -F"'" '{print $2}'`
LIBRARY_NAME=`cat library/setup.py | grep name | awk -F"'" '{print $2}'`

printf "$LIBRARY_NAME $LIBRARY_VERSION Python Library: Installer\n\n"

if [ $(id -u) -ne 0 ]; then
printf "Script must be run as root. Try 'sudo ./install.sh'\n"
Expand Down
5 changes: 5 additions & 0 deletions library/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
[metadata]
# This includes the license file(s) in the wheel.
# https://wheel.readthedocs.io/en/stable/user_guide.html#including-license-files-in-the-generated-wheel-file
license_files = LICENSE.txt

[flake8]
exclude =
.tox,
Expand Down
4 changes: 2 additions & 2 deletions library/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
license='MIT',
keywords='Raspberry Pi',
url='http://www.pimoroni.com',
project_urls={'GitHub': 'https://www.github.com/pimoroni/{{LIBNAME}}-python'},
classifiers=classifiers,
packages=['keybow'],
install_requires=[]
packages=['keybow']
)
5 changes: 5 additions & 0 deletions library/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ deps =
commands =
flake8 --ignore E501
rstcheck README.rst
check-manifest --ignore tox.ini,tests*,.coveragerc
python setup.py check -m -r -s
flake8 --ignore E501
rstcheck README.rst
deps =
check-manifest
flake8
rstcheck
9 changes: 5 additions & 4 deletions uninstall.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/bin/bash

PACKAGE="keybow"
LIBRARY_VERSION=`cat library/setup.py | grep version | awk -F"'" '{print $2}'`
LIBRARY_NAME=`cat library/setup.py | grep name | awk -F"'" '{print $2}'`

printf "KEYBOW Python Library: Uninstaller\n\n"
printf "$LIBRARY_NAME $LIBRARY_VERSION Python Library: Uninstaller\n\n"

if [ $(id -u) -ne 0 ]; then
printf "Script must be run as root. Try 'sudo ./uninstall.sh'\n"
Expand All @@ -12,11 +13,11 @@ fi
cd library

printf "Unnstalling for Python 2..\n"
pip uninstall $PACKAGE
pip uninstall $LIBRARY_NAME

if [ -f "/usr/bin/pip3" ]; then
printf "Uninstalling for Python 3..\n"
pip3 uninstall $PACKAGE
pip3 uninstall $LIBRARY_NAME
fi

cd ..
Expand Down

0 comments on commit 86c38d1

Please sign in to comment.