tox: Use conditional targets

This simplifies our tox file and reduces duplication.

Change-Id: I085899e00a249fb850c81737b1088bb82ce820ba
This commit is contained in:
Stephen Finucane 2016-07-06 13:40:03 +01:00
parent 0d6d1616b9
commit 17630d37fc

21
tox.ini
View File

@ -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}