Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,20 @@ jobs:
- image: circleci/python:3.5.3
environment:
CI: cicleci
POSTGRES_DB: circle_test
DEBIAN_FRONTEND: noninteractive
steps:
- checkout
- run:
name: "fetch and pull"
command: |
git fetch && git pull --all || true
- run:
shell: /bin/bash
name: "install depends attempt"
command: |
python3 -m pip install --user -r ./requirements.txt || true
- run:
shell: /bin/bash
name: "install coverage attempt"
command: |
python3 -m pip install --user coverage || true
Expand All @@ -32,15 +38,17 @@ jobs:
command: |
make test
- run:
shell: /bin/bash
name: "clean up from test"
command: |
make clean
- run:
shell: /bin/bash
name: "check code style"
name: "check code style and spelling"
command: |
make test-style || python3 -m flake8 --ignore=W191,W391 --max-line-length=100 --verbose --count --config=.flake8.ini --max-complexity=15
- run:
shell: /bin/bash
name: "clean up when done"
command: |
make clean
Expand Down
25 changes: 24 additions & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,50 @@ coverage:
piaplib.book:
target: 90%
flags: book
base: auto
paths:
- piaplib/book
piaplib.pku:
target: 70%
flags: pku
base: auto
paths:
- piaplib/pku
piaplib.lint:
target: 70%
flags: lint
base: auto
paths:
- piaplib/lint
piaplib.keyring:
target: 90%
flags: keyring
base: auto
paths:
- piaplib/keyring
tests:
target: 80%
flags: tests
base: auto
paths:
- tests

notify:
slack:
default:
url: secret:RyYF2QemmISpOyoWnSEeRHbhHRBEV6dM07jBCvdGXsdUtyJjp6MOOPmnhBFJ1bfkwyncbf51Bu9bVa5atAyvehOAdrotKVkMbrm1U4GWFh+XEWXLDjywBSCXcVw+QL9gCBGljDoJcBs+5kLYTJfuoJ+Hty287xYWOgKLCvjXFKo=
threshold: 2%
only_pulls: false
branches: null
flags:
- piaplib
- tests
paths:
- piaplib/
- piaplib/lint
- piaplib/pku
- piaplib/keyring
- piaplib/book
- tests/
flags:
piaplib:
paths:
Expand Down
6 changes: 4 additions & 2 deletions .stickler.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
linters:
shellcheck:
shell: bash
exclude: ['.git', 'tests']
flake8:
max-line-length: 100
max-complexity: 10
max-complexity: 15
ignore: 'W191,W391'
exclude: ['.git', '__pycache__', 'docs', '.tox', 'build']
format: default
files:
ignore: ['*/*.pyc', '*.pyc', '*~', '.git', '__pycache__']
ignore: ['*/*.pyc', '.tox/*', '*.pyc', '*~', '.git', '__pycache__', '*/__pycache__/*']
69 changes: 36 additions & 33 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,42 +10,40 @@ addons:
hosts:
- pocket.PiAP.local

env:

matrix:
include:
- os: linux
python: "2.7"
dist: trusty
- os: linux
python: "2.7"
dist: precice
- os: linux
python: "3.3"
dist: trusty
- os: linux
python: "3.4"
- os: linux
python: "3.5"
dist: trusty
- os: linux
python: "3.5"
dist: precice
dist: trusty
env: TRAVIS_PYTHON_VERSION="3.5"
- os: linux
python: "3.6"
- os: linux
dist: trusty
python: "3.5-dev" # 3.5 development branch
- os: linux
python: "3.6-dev"
- os: linux
python: "3.7-dev"
- os: linux
python: "pypy" # PyPy2 2.5.0
dist: precise
python: "pypy" # PyPy2 2.5.0
- os: linux
python: "pypy3"
- os: linux
python: "pypy-5.3.1"
- os: linux
python: "nightly" # currently points to 3.6-dev
- os: osx
osx_image: xcode6.4
language: generic
python: "nightly" # currently points to 3.7-dev
- os: osx
osx_image: xcode7.2
language: generic
Expand All @@ -62,13 +60,15 @@ matrix:
osx_image: xcode9
language: generic
allow_failure:
- os: osx
osx_image: xcode6.4
language: generic
- os: linux
python: "2.6"
- os: linux
python: "3.2"
- os: linux
python: "pypy"
dist: precise
- os: linux
python: "pypy3"
- os: linux
Expand All @@ -77,29 +77,31 @@ matrix:
install: "make init"

before_install:
- if [ $TRAVIS_OS_NAME == osx ] ; then travis_wait git -C "$(brew --repo homebrew/core)" fetch --unshallow || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then travis_retry brew tap homebrew/versions || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then travis_wait brew upgrade || travis_retry brew upgrade || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install python2.6 $INSTALL || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install python26 $INSTALL || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then travis_wait brew install python3 $INSTALL || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install python3.3 $INSTALL || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install py3.3 $INSTALL || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install python3.4 $INSTALL || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install python34 $INSTALL || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install py3.4 $INSTALL || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install python3.5 $INSTALL || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install python35 $INSTALL || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install py3.5 $INSTALL || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install python3.6 $INSTALL || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install python36 $INSTALL || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install py3.6 $INSTALL || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install python2.7 $INSTALL || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install python27 $INSTALL || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install py2.7 $INSTALL || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install python3.6 $INSTALL || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install python3.7 $INSTALL || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install python2.6 || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install python26 || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then travis_wait brew install python3 || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install python3.3 || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install py3.3 || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install python3.4 || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install python34 || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install py3.4 || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install python3.5 || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install python35 || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install py3.5 || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install python3.6 || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install python36 || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install py3.6 || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install python2.7 || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install python27 || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install py2.7 || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install python3.6 || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install python3.7 || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install coverage $INSTALL || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install codecov $INSTALL || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install codecov || true ; fi
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install pip || true ; fi
- travis_retry pip install tox || pip install tox || true ;
- travis_retry pip install coverage || true ;
- travis_retry pip install codecov || true ;
Expand All @@ -109,6 +111,7 @@ before_install:
- travis_retry python3 -m pip install coverage || python3 -m pip install coverage || true ;
- travis_retry python3 -m pip install codecov || python3 -m pip install codecov || true ;
- travis_retry python3 -m pip install -r requirements.txt || python3 -m pip install -r requirements.txt || true ;
- echo "Dependencies should be sane now."

script:
- make clean ;
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
# copies or substantial portions of the Software.
#

SHELL=/bin/bash

ifeq "$(ECHO)" ""
ECHO=echo
Expand Down Expand Up @@ -121,11 +122,13 @@ test-tox: cleanup

test-style: cleanup
$(QUIET)flake8 --ignore=W191,W391 --max-line-length=100 --verbose --count --config=.flake8.ini
$(QUIET)tests/check_spelling 2>/dev/null || true
$(QUIET)$(ECHO) "$@: Done."

cleanup:
$(QUIET)rm -f tests/*.pyc 2>/dev/null || true
$(QUIET)rm -f tests/*~ 2>/dev/null || true
$(QUIET)rm -Rf docs/_build 2>/dev/null || true
$(QUIET)rm -Rf tests/__pycache__ 2>/dev/null || true
$(QUIET)rm -f piaplib/*.pyc 2>/dev/null || true
$(QUIET)rm -Rf piaplib/__pycache__ 2>/dev/null || true
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
### Stable:
[![status](https://travis-ci.org/reactive-firewall/PiAP-python-tools.svg?branch=stable)](https://travis-ci.org/reactive-firewall/PiAP-python-tools)
[![CircleCI](https://circleci.com/gh/reactive-firewall/PiAP-python-tools/tree/stable.svg?style=svg)](https://circleci.com/gh/reactive-firewall/PiAP-python-tools/tree/stable)
[![Python 3](https://pyup.io/repos/github/reactive-firewall/PiAP-python-tools/python-3-shield.svg)](https://pyup.io/repos/github/reactive-firewall/PiAP-python-tools/)
[![Updates](https://pyup.io/repos/github/reactive-firewall/PiAP-python-tools/shield.svg)](https://pyup.io/repos/github/reactive-firewall/PiAP-python-tools/)
[![Dependency Status](https://gemnasium.com/badges/github.com/reactive-firewall/PiAP-python-tools.svg)](https://gemnasium.com/github.com/reactive-firewall/PiAP-python-tools)
[![Dependency Status](https://www.versioneye.com/user/projects/5961fc36368b08002a056e48/badge.svg?style=flat-round)](https://www.versioneye.com/user/projects/5961fc36368b08002a056e48)
[![code coverage](https://codecov.io/gh/reactive-firewall/PiAP-python-tools/branch/stable/graph/badge.svg)](https://codecov.io/gh/reactive-firewall/PiAP-python-tools/branch/stable/)
[![Coverage Status](https://coveralls.io/repos/github/reactive-firewall/PiAP-python-tools/badge.svg?branch=stable)](https://coveralls.io/github/reactive-firewall/PiAP-python-tools?branch=stable)
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
# The short X.Y version.
version = 'v0.2'
# The full version, including alpha/beta/rc tags.
release = 'v0.2.8'
release = 'v0.2.9'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
# argparse - builtin - PSF licence
argparse>=1.4.0
# argparse - builtin - PSF licence
setuptools>=35.0.2
setuptools>=36.5.0
# virtualenv - MIT
virtualenv>=15.0.1
# six - MIT
six>=1.0.0
# pgpy - BSD 3-Clause licensed
#pgpy>=0.4.1
tox>=2.7.0
tox>=2.8.0
#py>=1.4.33
pip>=8.2
pip>=9.0
requests>=2.14.2
# cryptography - Apache 2
#cryptography>=1.2.3
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = piaplib
version = 0.2.8
version = 0.2.9
author = Mr. Walls
author-email = reactive-firewall@users.noreply.github.com
summary = Beta python tools for PiAP
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

setup(
name="""piaplib""",
version="""0.2.8""",
version="""0.2.9""",
description="""Beta for PiAP python tools""",
long_description=readme,
install_requires=requirements,
Expand Down
19 changes: 19 additions & 0 deletions tests/check_spelling
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#! /bin/bash

# exit fast if command is missing
test -x $(which spellintian) || exit 0 ;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quote this to prevent word splitting.


THE_TEMP_FILE="/tmp/swapfile_spellcheck_${RANDOM}.tmp.txt" ;
( (spellintian ${@:-./**/*} 2>/dev/null | fgrep " -> ") & (spellintian ${@:-./*} 2>/dev/null | fgrep " -> ") & (spellintian ${@:-./**/**/*} 2>/dev/null | fgrep " -> ") ) | sort -h | uniq | tee -a ${THE_TEMP_FILE:-/dev/null} ;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double quote array expansions, otherwise they're like $* and break on spaces.

wait ;
THECOUNT=$( (wc -l ${THE_TEMP_FILE} 2>/dev/null || echo 0) | cut -d\ -f 1 ) ;
EXIT_CODE=${THECOUNT} ;
if [[ ("${THECOUNT}" -le 1) ]] ; then
EXIT_CODE=0 ;
echo "OK: Found no detected spelling errors." ;
else
echo "FAIL: Found ${THECOUNT:-many} spelling errors." ;
fi
rm -f ${THE_TEMP_FILE} 2>/dev/null >> /dev/null || true ;
wait ;
exit ${EXIT_CODE:255} ;
Loading