From da910ace0f94bddad8c9adc462e4eb7d6e40dccc Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Wed, 6 Jun 2018 16:06:01 -0400 Subject: [PATCH] fix tox python3 overrides We want to default to running all tox environments under python 3, so set the basepython value in each environment. We do not want to specify a minor version number, because we do not want to have to update the file every time we upgrade python. We do not want to set the override once in testenv, because that breaks the more specific versions used in default environments like py35 and py36. Change-Id: Idba5b407405e7d1457a02b074bf60b7fded284ee Signed-off-by: Doug Hellmann --- tox.ini | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tox.ini b/tox.ini index fd10c3a799..422f683b54 100644 --- a/tox.ini +++ b/tox.ini @@ -22,6 +22,7 @@ commands = bash tools/pretty_tox.sh '{posargs}' [testenv:debug] +basepython = python3 commands = oslo_debug_helper -t magnum/tests/unit {posargs} [testenv:debug-py27] @@ -110,6 +111,7 @@ commands = bash tools/pretty_tox.sh '{posargs}' [testenv:pep8] +basepython = python3 commands = doc8 -e .rst specs/ doc/source/ contrib/ CONTRIBUTING.rst HACKING.rst README.rst bash tools/flake8wrap.sh {posargs} @@ -123,24 +125,30 @@ commands = -print0 | xargs -0 bashate -v -iE006,E010,E042 -eE005" [testenv:venv] +basepython = python3 commands = {posargs} [testenv:bandit] +basepython = python3 deps = -r{toxinidir}/test-requirements.txt commands = bandit -r magnum -x tests -n5 -ll [testenv:cover] +basepython = python3 commands = {toxinidir}/tools/cover.sh {posargs} [testenv:docs] +basepython = python3 deps = -r{toxinidir}/doc/requirements.txt commands = sphinx-build -W -b html doc/source doc/build/html [testenv:genconfig] +basepython = python3 commands = oslo-config-generator --config-file etc/magnum/magnum-config-generator.conf [testenv:genpolicy] +basepython = python3 commands = oslopolicy-sample-generator --config-file etc/magnum/magnum-policy-generator.conf @@ -156,6 +164,7 @@ exclude = .venv,.git,.tox,dist,*lib/python*,*egg,build,tools,releasenotes local-check-factory = magnum.hacking.checks.factory [testenv:pip-check-reqs] +basepython = python3 # do not install test-requirements as that will pollute the virtualenv for # determining missing packages # this also means that pip_check_reqs must be installed separately, outside @@ -165,15 +174,18 @@ deps = pip_check_reqs commands=pip-missing-reqs -d --ignore-file=magnum/tests/* magnum [testenv:releasenotes] +basepython = python3 deps = -r{toxinidir}/doc/requirements.txt commands = rm -rf releasenotes/build sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html [testenv:install-guide] +basepython = python3 commands = sphinx-build -a -E -W -d install-guide/build/doctrees -b html install-guide/source install-guide/build/html [testenv:api-ref] +basepython = python3 deps = -r{toxinidir}/doc/requirements.txt commands = rm -rf api-ref/build @@ -189,6 +201,7 @@ deps = # This environment can be used to quickly validate that all needed system # packages required to successfully execute test targets are installed [testenv:bindep] +basepython = python3 # Do not install any requirements. We want this to be fast and work even if # system dependencies are missing, since it's used to tell you what system # dependencies are missing! This also means that bindep must be installed