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: I78f552cfb434b6bac30a77c5f2011636308fbbee
This commit is contained in:
qingszhao 2018-06-12 00:43:26 +08:00 committed by Sorin Sbarnea
parent 561081fef0
commit 51a4ccab70

10
tox.ini
View File

@ -24,6 +24,7 @@ whitelist_externals =
find find
[testenv:tips] [testenv:tips]
basepython = python3
# tests what happens with unreleased version of dependencies, like python-jenkins # tests what happens with unreleased version of dependencies, like python-jenkins
install_command = pip install -U {opts} {packages} install_command = pip install -U {opts} {packages}
commands = commands =
@ -33,6 +34,7 @@ commands =
stestr run --slowest {posargs} stestr run --slowest {posargs}
[testenv:cover] [testenv:cover]
basepython = python3
setenv = setenv =
{[testenv]setenv} {[testenv]setenv}
PYTHON=coverage run --source jenkins_jobs --parallel-mode PYTHON=coverage run --source jenkins_jobs --parallel-mode
@ -43,31 +45,39 @@ commands =
coverage xml -o cover/coverage.xml coverage xml -o cover/coverage.xml
[testenv:pep8] [testenv:pep8]
basepython = python3
commands = flake8 commands = flake8
[testenv:pyflakes] [testenv:pyflakes]
basepython = python3
deps = pyflakes deps = pyflakes
commands = pyflakes jenkins_jobs tests setup.py commands = pyflakes jenkins_jobs tests setup.py
[testenv:compare-xml-config] [testenv:compare-xml-config]
basepython = python3
commands = jenkins-jobs {posargs:test -o .test/run-conf/default/out/ .test/run-conf/config/} commands = jenkins-jobs {posargs:test -o .test/run-conf/default/out/ .test/run-conf/config/}
[testenv:compare-xml-old] [testenv:compare-xml-old]
basepython = python3
commands = jenkins-jobs test -o .test/old/out/ .test/old/config/ commands = jenkins-jobs test -o .test/old/out/ .test/old/config/
[testenv:compare-xml-new] [testenv:compare-xml-new]
basepython = python3
commands = jenkins-jobs test -o .test/new/out/ .test/new/config/ commands = jenkins-jobs test -o .test/new/out/ .test/new/config/
[testenv:docs] [testenv:docs]
basepython = python3
commands = python setup.py build_sphinx {posargs} commands = python setup.py build_sphinx {posargs}
[testenv:docs-linkcheck] [testenv:docs-linkcheck]
basepython = python3
# If you are behind a proxy, for this test to work you will need to set # If you are behind a proxy, for this test to work you will need to set
# TOX_TESTENV_PASSENV="http_proxy https_proxy no_proxy ..." to pass # TOX_TESTENV_PASSENV="http_proxy https_proxy no_proxy ..." to pass
# through the proxy environment settings to be able to validate any urls. # through the proxy environment settings to be able to validate any urls.
commands = python setup.py build_sphinx -b linkcheck commands = python setup.py build_sphinx -b linkcheck
[testenv:venv] [testenv:venv]
basepython = python3
commands = {posargs} commands = {posargs}
[flake8] [flake8]