Updated script to support Python 2.7 and Python 3.x

master
Chris Caron 2019-03-03 23:49:33 -05:00
parent edba5512bf
commit ef0095eb56
1 changed files with 19 additions and 9 deletions

@ -20,32 +20,42 @@ I also have this small (very simple) script that I run each time before I push m
# apprise root directory (after being checked out from # apprise root directory (after being checked out from
# github). # github).
# Cleanup
cleanup() { cleanup() {
# Simple safety checking (ensure we're in the right dir)
[ ! -d "apprise" ] && return 1
[ ! -d "apprise/plugins" ] && return 1
[ ! -d "apprise/config" ] && return 1
[ ! -d "test" ] && return 1
# we can safely assume we're being ran at the root of the apprise
# directory
rm -rf .tox/ .eggs .coverage .cache \ rm -rf .tox/ .eggs .coverage .cache \
apprise.egg-info htmlcov build &>/dev/null apprise.egg-info htmlcov build &>/dev/null
find . -type d -name __pycache__ \
-exec rm -rf {} \; &>/dev/null
find . -maxdepth 1 -mindepth 1 -type f \
-name '.coverage.*' -delete
return 0
} }
# In case it wasn't ran before (or we ctrl-c'ed last time); we # Incase it wasn't ran before (or we ctrl-c'ed last time)
# want to just clean up any lingering content from the last time
# we may or may have not done a checkdone.sh
cleanup cleanup
# Check for pep8 flake8 . --show-source --statistics && \
flake8 . --count --show-source --statistics flake8-3 . --show-source --statistics
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "pep8 failed; early exit." echo "pep8 failed; early exit."
exit 1 exit 1
fi fi
# Handle our coverage coverage run --parallel -m pytest -vv && \
coverage run ./setup.py test coverage3 run --parallel -m pytest -vv
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "tests failed; early exit." echo "tests failed; early exit."
exit 1 exit 1
fi fi
# Print it to screen coverage combine
coverage report --show-missing coverage report --show-missing
# Cleanup # Cleanup