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 <doug@doughellmann.com>
This commit is contained in:
Doug Hellmann 2018-06-06 16:06:01 -04:00
parent 3d02fd7c99
commit da910ace0f

13
tox.ini
View File

@ -22,6 +22,7 @@ commands =
bash tools/pretty_tox.sh '{posargs}' bash tools/pretty_tox.sh '{posargs}'
[testenv:debug] [testenv:debug]
basepython = python3
commands = oslo_debug_helper -t magnum/tests/unit {posargs} commands = oslo_debug_helper -t magnum/tests/unit {posargs}
[testenv:debug-py27] [testenv:debug-py27]
@ -110,6 +111,7 @@ commands =
bash tools/pretty_tox.sh '{posargs}' bash tools/pretty_tox.sh '{posargs}'
[testenv:pep8] [testenv:pep8]
basepython = python3
commands = commands =
doc8 -e .rst specs/ doc/source/ contrib/ CONTRIBUTING.rst HACKING.rst README.rst doc8 -e .rst specs/ doc/source/ contrib/ CONTRIBUTING.rst HACKING.rst README.rst
bash tools/flake8wrap.sh {posargs} bash tools/flake8wrap.sh {posargs}
@ -123,24 +125,30 @@ commands =
-print0 | xargs -0 bashate -v -iE006,E010,E042 -eE005" -print0 | xargs -0 bashate -v -iE006,E010,E042 -eE005"
[testenv:venv] [testenv:venv]
basepython = python3
commands = {posargs} commands = {posargs}
[testenv:bandit] [testenv:bandit]
basepython = python3
deps = -r{toxinidir}/test-requirements.txt deps = -r{toxinidir}/test-requirements.txt
commands = bandit -r magnum -x tests -n5 -ll commands = bandit -r magnum -x tests -n5 -ll
[testenv:cover] [testenv:cover]
basepython = python3
commands = {toxinidir}/tools/cover.sh {posargs} commands = {toxinidir}/tools/cover.sh {posargs}
[testenv:docs] [testenv:docs]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt deps = -r{toxinidir}/doc/requirements.txt
commands = sphinx-build -W -b html doc/source doc/build/html commands = sphinx-build -W -b html doc/source doc/build/html
[testenv:genconfig] [testenv:genconfig]
basepython = python3
commands = commands =
oslo-config-generator --config-file etc/magnum/magnum-config-generator.conf oslo-config-generator --config-file etc/magnum/magnum-config-generator.conf
[testenv:genpolicy] [testenv:genpolicy]
basepython = python3
commands = commands =
oslopolicy-sample-generator --config-file etc/magnum/magnum-policy-generator.conf 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 local-check-factory = magnum.hacking.checks.factory
[testenv:pip-check-reqs] [testenv:pip-check-reqs]
basepython = python3
# do not install test-requirements as that will pollute the virtualenv for # do not install test-requirements as that will pollute the virtualenv for
# determining missing packages # determining missing packages
# this also means that pip_check_reqs must be installed separately, outside # 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 commands=pip-missing-reqs -d --ignore-file=magnum/tests/* magnum
[testenv:releasenotes] [testenv:releasenotes]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt deps = -r{toxinidir}/doc/requirements.txt
commands = commands =
rm -rf releasenotes/build rm -rf releasenotes/build
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:install-guide] [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 commands = sphinx-build -a -E -W -d install-guide/build/doctrees -b html install-guide/source install-guide/build/html
[testenv:api-ref] [testenv:api-ref]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt deps = -r{toxinidir}/doc/requirements.txt
commands = commands =
rm -rf api-ref/build rm -rf api-ref/build
@ -189,6 +201,7 @@ deps =
# This environment can be used to quickly validate that all needed system # This environment can be used to quickly validate that all needed system
# packages required to successfully execute test targets are installed # packages required to successfully execute test targets are installed
[testenv:bindep] [testenv:bindep]
basepython = python3
# Do not install any requirements. We want this to be fast and work even if # 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 # system dependencies are missing, since it's used to tell you what system
# dependencies are missing! This also means that bindep must be installed # dependencies are missing! This also means that bindep must be installed