From 17630d37fcc9168fe8e213e01c83f2edf5b45590 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Wed, 6 Jul 2016 13:40:03 +0100 Subject: [PATCH] tox: Use conditional targets This simplifies our tox file and reduces duplication. Change-Id: I085899e00a249fb850c81737b1088bb82ce820ba --- tox.ini | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/tox.ini b/tox.ini index 38cb03b1f118..499e66b10e9b 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] minversion = 2.0 -envlist = py34,py27,functional,pep8,pip-missing-reqs +envlist = py{34,27},functional,pep8,pip-missing-reqs skipsdist = True [testenv] @@ -15,8 +15,12 @@ setenv = VIRTUAL_ENV={envdir} LC_ALL=en_US.utf-8 PYTHONDONTWRITEBYTECODE=1 deps = -r{toxinidir}/test-requirements.txt +# NOTE(mriedem): If py34 fails with "db type could not be determined", delete +# .testrepository and try again. Running py34 before py27 is OK, but not the +# other way around. See: https://bugs.launchpad.net/testrepository/+bug/1212909 commands = - bash tools/pretty_tox.sh '{posargs}' + py27: bash tools/pretty_tox.sh '{posargs}' + py{34,35}: bash tools/pretty_tox3.sh '{posargs}' passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY OS_DEBUG # there is also secret magic in pretty_tox.sh which lets you run in a fail only # mode. To do this define the TRACE_FAILONLY environmental variable. @@ -27,19 +31,6 @@ deps = hacking commands = bash tools/flake8wrap.sh {posargs} -[testenv:py34] -# NOTE(mriedem): If py34 fails with "db type could not be determined", delete -# .testrepository and try again. Running py34 before py27 is OK, but not the -# other way around. See: https://bugs.launchpad.net/testrepository/+bug/1212909 -setenv = {[testenv]setenv} -commands = - bash tools/pretty_tox3.sh '{posargs}' - -[testenv:py35] -setenv = {[testenv]setenv} -commands = - bash tools/pretty_tox3.sh '{posargs}' - [testenv:functional] usedevelop = True setenv = VIRTUAL_ENV={envdir}