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: I43b21411d01290ddea7ca5fe11d70e970bf65bb3
This commit is contained in:
huang.zhiping 2018-06-08 14:15:25 +08:00 committed by Alessandro Nesta
parent 5b1b564d57
commit 18197c5fed
1 changed files with 10 additions and 1 deletions

11
tox.ini
View File

@ -4,6 +4,7 @@ minversion = 1.6
skipsdist = True skipsdist = True
[testenv] [testenv]
basepython = python3
setenv = VIRTUAL_ENV={envdir} setenv = VIRTUAL_ENV={envdir}
usedevelop = True usedevelop = True
whitelist_externals = rm whitelist_externals = rm
@ -15,6 +16,7 @@ commands =
rm -f .testrepository/times.dbm rm -f .testrepository/times.dbm
[testenv:functional] [testenv:functional]
basepython = python3
setenv = OS_TEST_PATH=./apmec/tests/functional setenv = OS_TEST_PATH=./apmec/tests/functional
deps = deps =
{[testenv]deps} {[testenv]deps}
@ -36,6 +38,7 @@ deps =
sitepackages = True sitepackages = True
[testenv:debug] [testenv:debug]
basepython = python3
commands = oslo_debug_helper {posargs} commands = oslo_debug_helper {posargs}
[testenv:debug-py27] [testenv:debug-py27]
@ -56,6 +59,7 @@ commands =
whitelist_externals = bash whitelist_externals = bash
[testenv:i18n] [testenv:i18n]
basepython = python3
commands = python ./tools/check_i18n.py ./apmec ./tools/i18n_cfg.py commands = python ./tools/check_i18n.py ./apmec ./tools/i18n_cfg.py
[testenv:docs] [testenv:docs]
@ -65,6 +69,7 @@ commands =
python setup.py build_sphinx python setup.py build_sphinx
[testenv:api-ref] [testenv:api-ref]
basepython = python3
# This environment is called from CI scripts to test and publish # This environment is called from CI scripts to test and publish
# the API Ref to developer.openstack.org. # the API Ref to developer.openstack.org.
commands = commands =
@ -73,11 +78,12 @@ commands =
whitelist_externals = rm whitelist_externals = rm
[testenv:releasenotes] [testenv:releasenotes]
basepython = python3
commands = commands =
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:cover] [testenv:cover]
basepython = python3
# Also do not run test_coverage_ext tests while gathering coverage as those # Also do not run test_coverage_ext tests while gathering coverage as those
# tests conflict with coverage. # tests conflict with coverage.
commands = commands =
@ -86,6 +92,7 @@ commands =
coverage report coverage report
[testenv:venv] [testenv:venv]
basepython = python3
commands = {posargs} commands = {posargs}
[flake8] [flake8]
@ -101,10 +108,12 @@ import_exceptions = apmec._i18n
local-check-factory = apmec.hacking.checks.factory local-check-factory = apmec.hacking.checks.factory
[testenv:config-gen] [testenv:config-gen]
basepython = python3
commands = commands =
oslo-config-generator --config-file=etc/config-generator.conf oslo-config-generator --config-file=etc/config-generator.conf
[testenv:lower-constraints] [testenv:lower-constraints]
basepython = python3
deps = deps =
-c{toxinidir}/lower-constraints.txt -c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt -r{toxinidir}/test-requirements.txt