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: Ic87686868f784f0e1b514d6b899cc16240d88d61
This commit is contained in:
huang.zhiping 2018-06-09 02:08:21 +08:00 committed by Alessandro Nesta
parent c6ad0f0ead
commit 0feeaf1f9b

View File

@ -16,12 +16,15 @@ setenv =
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
[testenv:venv] [testenv:venv]
basepython = python3
commands = {posargs} commands = {posargs}
[testenv:releasenotes] [testenv:releasenotes]
basepython = python3
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:cover] [testenv:cover]
basepython = python3
setenv = setenv =
{[testenv]setenv} {[testenv]setenv}
PYTHON=coverage run --branch --omit='*test*' --source ironic_inspector --parallel-mode PYTHON=coverage run --branch --omit='*test*' --source ironic_inspector --parallel-mode
@ -33,7 +36,7 @@ commands =
coverage html -d ./cover --omit='*test*' coverage html -d ./cover --omit='*test*'
[testenv:pep8] [testenv:pep8]
basepython = python2.7 basepython = python3
commands = commands =
flake8 ironic_inspector flake8 ironic_inspector
doc8 README.rst CONTRIBUTING.rst doc/source doc8 README.rst CONTRIBUTING.rst doc/source
@ -49,15 +52,18 @@ commands =
python3 -m ironic_inspector.test.functional python3 -m ironic_inspector.test.functional
[testenv:genconfig] [testenv:genconfig]
basepython = python3
envdir = {toxworkdir}/venv envdir = {toxworkdir}/venv
commands = oslo-config-generator --config-file config-generator.conf commands = oslo-config-generator --config-file config-generator.conf
[testenv:genpolicy] [testenv:genpolicy]
basepython = python3
sitepackages = False sitepackages = False
envdir = {toxworkdir}/venv envdir = {toxworkdir}/venv
commands = oslopolicy-sample-generator --config-file {toxinidir}/policy-generator.conf commands = oslopolicy-sample-generator --config-file {toxinidir}/policy-generator.conf
[testenv:genstates] [testenv:genstates]
basepython = python3
deps = {[testenv]deps} deps = {[testenv]deps}
commands = {toxinidir}/tools/states_to_dot.py -f {toxinidir}/doc/source/images/states.svg --format svg commands = {toxinidir}/tools/states_to_dot.py -f {toxinidir}/doc/source/images/states.svg --format svg
@ -78,6 +84,7 @@ application-import-names = ironic_inspector
import_exceptions = ironicclient.exceptions,ironic_inspector.common.i18n import_exceptions = ironicclient.exceptions,ironic_inspector.common.i18n
[testenv:docs] [testenv:docs]
basepython = python3
setenv = PYTHONHASHSEED=0 setenv = PYTHONHASHSEED=0
sitepackages = False sitepackages = False
deps = -r{toxinidir}/test-requirements.txt deps = -r{toxinidir}/test-requirements.txt