From 42d849fe5203aa3ab49192bf58a9c4b3812663b5 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Sun, 10 Feb 2019 11:02:15 -0800 Subject: [PATCH 1/4] tox/travis: improve nodilate testing 'tox' run locally should only exercise sensible combinations (py27-nodilate, py34-nodilate, py35/36/37 with dilate). Travis will run exactly these by using a different script for each version of python. Also added a separate flake8 builder (which uses a small subset of warnings, as the default set is currently much too noisy). --- .travis.yml | 19 ++++++++----------- tox.ini | 29 +++++++++++++---------------- 2 files changed, 21 insertions(+), 27 deletions(-) diff --git a/.travis.yml b/.travis.yml index fcfc1d4..c5bb77e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,30 +11,27 @@ branches: - /^WIP-.*$/ install: - pip install -U pip tox virtualenv codecov -before_script: - - if [[ $TRAVIS_PYTHON_VERSION == 3.6 ]]; then - pip install -U flake8 ; - flake8 *.py src --count --select=E901,E999,F821,F822,F823 --statistics ; - fi -script: - - if [[ $TRAVIS_PYTHON_VERSION == 2.7 || $TRAVIS_PYTHON_VERSION == 3.4 ]]; then - tox -e no-dilate ; - else - tox -e coverage ; - fi after_success: - codecov matrix: include: - python: 2.7 + script: tox -e py27-nodilate - python: 3.4 + script: tox -e py34-nodilate - python: 3.5 + script: tox -e py35-coverage - python: 3.6 + script: tox -e py36-coverage - python: 3.7 # we don't actually need sudo, but that kicks us onto GCE, which lets # us get xenial sudo: true dist: xenial + script: tox -e py37-coverage - python: nightly + script: tox -e py-coverage + - python: 3.6 + script: tox -e flake8 allow_failures: - python: nightly diff --git a/tox.ini b/tox.ini index 3c01425..d9c499b 100644 --- a/tox.ini +++ b/tox.ini @@ -4,22 +4,25 @@ # and then run "tox" from this directory. [tox] -envlist = {py27,py34,py35,py36,py37,pypy,flake8} +# useful envs: py27-nodilate, py34-nodilate, py35, py36, py37, pypy, flake8 +envlist = {py27-nodilate,py34-nodilate,py35,py36,py37} skip_missing_interpreters = True minversion = 2.4.0 [testenv] usedevelop = True -extras = dev,dilate +extras = + nodilate: dev + !nodilate: dev, dilate deps = pyflakes >= 1.2.3 + coverage: coverage commands = pyflakes setup.py src wormhole --version - python -m wormhole.test.run_trial {posargs:wormhole} - -[testenv:no-dilate] -extras = dev + !coverage: python -m wormhole.test.run_trial {posargs:wormhole} + coverage: coverage run --branch -m wormhole.test.run_trial {posargs:wormhole} + coverage: coverage xml # on windows, trial is installed as venv/bin/trial.py, not .exe, but (at # least appveyor) adds .PY to $PATHEXT. So "trial wormhole" might work on @@ -29,16 +32,6 @@ extras = dev # vary on the platform. So we added a small class (wormhole.test.run_trial) # that does the right import for us. -[testenv:coverage] -deps = - pyflakes >= 1.2.3 - coverage -commands = - pyflakes setup.py src - wormhole --version - coverage run --branch -m wormhole.test.run_trial {posargs:wormhole} - coverage xml - [testenv:flake8] deps = flake8 commands = flake8 src/wormhole @@ -47,3 +40,7 @@ commands = flake8 src/wormhole ignore = E741,W503,W504 exclude = .git,__pycache__,docs/source/conf.py,old,build,dist max-complexity = 40 + +[testenv:flake8less] +deps = flake8 +commands = flake8 --select=E901,E999,F821,F822,F823 src/wormhole From b65678e5d2fdcbe1f0bb0210db8601ec213b4f7c Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Sun, 10 Feb 2019 11:07:43 -0800 Subject: [PATCH 2/4] travis: mark FLAKE8 build with an env --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index c5bb77e..0d8ed49 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,5 +33,6 @@ matrix: script: tox -e py-coverage - python: 3.6 script: tox -e flake8 + env: FLAKE8 allow_failures: - python: nightly From 31de77a875d11782a7f943ed687ab792d55e3b7a Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Sun, 10 Feb 2019 11:08:00 -0800 Subject: [PATCH 3/4] travis: py37 should no longer require sudo (once upon a time, sudo:true was necessary to get onto a GCE instance, which has xenail which has py37) --- .travis.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0d8ed49..175e6ab 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,9 +24,6 @@ matrix: - python: 3.6 script: tox -e py36-coverage - python: 3.7 - # we don't actually need sudo, but that kicks us onto GCE, which lets - # us get xenial - sudo: true dist: xenial script: tox -e py37-coverage - python: nightly From 41129faca5c76c3b8596af6bee6f1e3fb0bf8617 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Sun, 10 Feb 2019 11:10:39 -0800 Subject: [PATCH 4/4] travis: run flake8less, not the full flake8 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 175e6ab..70be178 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,7 +29,7 @@ matrix: - python: nightly script: tox -e py-coverage - python: 3.6 - script: tox -e flake8 + script: tox -e flake8less env: FLAKE8 allow_failures: - python: nightly