From 0225a988b3585dde83b2db1e97573eb054a9d701 Mon Sep 17 00:00:00 2001 From: Eric Fried Date: Thu, 12 Jul 2018 16:03:03 -0500 Subject: [PATCH] Use tox 3.1.1 fixes By 3.1.1, tox had fixed: - [1] which mishandled the basepython directive. - ignoring PYTHONDONTWRITEBYTECODE [2] Require this version and remove the workarounds. See ML thread [3] for some details [1] https://github.com/tox-dev/tox/issues/477 [2] https://github.com/tox-dev/tox/commit/336f4f6bd8b53223f940fc5cfc43b1bbd78d4699 [3] http://lists.openstack.org/pipermail/openstack-dev/2018-July/thread.html#132075 Change-Id: Iff442451c7a95caa7b9d22c76c341150175a34d1 --- tox.ini | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/tox.ini b/tox.ini index a023aae84c32..ecfeb09155e9 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,11 @@ [tox] -minversion = 2.1 +minversion = 3.1.1 envlist = py{27,35},functional,pep8 skipsdist = True +# Automatic envs (pyXX) will use the python version appropriate to that +# env and ignore basepython inherited from [testenv]. That's what we +# want, and we don't need to be warned about it. +ignore_basepython_conflict = True [testenv] basepython = python3 @@ -19,45 +23,31 @@ setenv = OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 OS_TEST_TIMEOUT=160 - # NOTE(efried): This is only effective in tox versions after 3.0.0rc1 - # https://github.com/tox-dev/tox/commit/336f4f6bd8b53223f940fc5cfc43b1bbd78d4699 PYTHONDONTWRITEBYTECODE=1 # TODO(stephenfin): Remove psycopg2 when minimum constraints is bumped to 2.8 PYTHONWARNINGS = ignore::UserWarning:psycopg2 deps = -r{toxinidir}/test-requirements.txt -commands = - find . -type f -name "*.pyc" -delete passenv = OS_DEBUG GENERATE_HASHES # there is also secret magic in subunit-trace which lets you run in a fail only # mode. To do this define the TRACE_FAILONLY environmental variable. [testenv:py27] -# TODO(efried): Remove this once https://github.com/tox-dev/tox/issues/425 is fixed. -basepython = python2.7 commands = - {[testenv]commands} stestr run {posargs} env TEST_OSPROFILER=1 stestr run --combine --no-discover 'nova.tests.unit.test_profiler' stestr slowest [testenv:py35] -# TODO(efried): Remove this once https://github.com/tox-dev/tox/issues/425 is fixed. -basepython = python3.5 commands = - {[testenv]commands} stestr run {posargs} env TEST_OSPROFILER=1 stestr run --combine --no-discover 'nova.tests.unit.test_profiler' [testenv:py36] -# TODO(efried): Remove this once https://github.com/tox-dev/tox/issues/425 is fixed. -basepython = python3.6 commands = {[testenv:py35]commands} [testenv:py37] -# TODO(efried): Remove this once https://github.com/tox-dev/tox/issues/425 is fixed. -basepython = python3.7 commands = {[testenv:py35]commands} @@ -100,7 +90,6 @@ deps = -r{toxinidir}/test-requirements.txt git+https://git.openstack.org/openstack/placement#egg=openstack-placement commands = - {[testenv]commands} # NOTE(cdent): The group_regex describes how stestr will group tests into the # same process when running concurently. The following ensures that gabbi tests # coming from the same YAML file are all in the same process. This is important @@ -142,7 +131,6 @@ setenv = GENERATE_SAMPLES=True PYTHONHASHSEED=0 commands = - {[testenv]commands} stestr --test-path=./nova/tests/functional/api_sample_tests run {posargs} stestr slowest @@ -171,7 +159,6 @@ setenv = {[testenv]setenv} PYTHON=coverage run --source nova --parallel-mode commands = - {[testenv]commands} coverage erase stestr run {posargs} coverage combine @@ -182,7 +169,6 @@ commands = [testenv:debug] envdir = {toxworkdir}/shared commands = - {[testenv]commands} oslo_debug_helper {posargs} [testenv:venv] @@ -198,7 +184,6 @@ description = Build main documentation. deps = -r{toxinidir}/doc/requirements.txt commands = - {[testenv]commands} rm -rf doc/build # Check that all JSON files don't have \r\n in line. bash -c "! find doc/ -type f -name *.json | xargs grep -U -n $'\r'" @@ -214,7 +199,6 @@ description = envdir = {toxworkdir}/docs deps = {[testenv:docs]deps} commands = - {[testenv]commands} rm -rf api-guide/build sphinx-build -W -b html -d api-guide/build/doctrees api-guide/source api-guide/build/html @@ -224,7 +208,6 @@ description = envdir = {toxworkdir}/docs deps = {[testenv:docs]deps} commands = - {[testenv]commands} rm -rf api-ref/build sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html @@ -234,7 +217,6 @@ description = envdir = {toxworkdir}/docs deps = {[testenv:docs]deps} commands = - {[testenv]commands} rm -rf releasenotes/build sphinx-build -W -b html -d releasenotes/build/doctrees releasenotes/source releasenotes/build/html @@ -300,5 +282,4 @@ deps = -r{toxinidir}/test-requirements.txt -r{toxinidir}/requirements.txt commands = - {[testenv]commands} stestr run {posargs}