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: I7c66c9701e4d6733a0ed9794f750326ce48d25ce
This commit is contained in:
zhulingjie 2018-06-08 18:46:18 -04:00 committed by caoyuan
parent 9553e89e62
commit cec52b1998

11
tox.ini
View File

@ -39,6 +39,7 @@ setenv =
[testenv:docs]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt
commands=
bash -c "rm -rf doc/build"
@ -48,6 +49,7 @@ commands=
[testenv:deploy-guide]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt
commands = sphinx-build -a -E -W -d deploy-guide/build/doctrees -b html deploy-guide/source deploy-guide/build/html
@ -60,6 +62,7 @@ extensions = .rst
[testenv:releasenotes]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt
commands =
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
@ -68,12 +71,14 @@ commands =
# environment used by the -infra templated docs job
[testenv:venv]
basepython = python3
commands =
{posargs}
[testenv:pep8]
basepython = python3
commands =
bash -c "{toxinidir}/tests/common/test-pep8.sh"
@ -88,6 +93,7 @@ ignore=F403
[testenv:bashate]
basepython = python3
commands =
bash -c "{toxinidir}/tests/common/test-bashate.sh"
@ -103,6 +109,7 @@ commands =
# or for a stable branch:
# http://git.openstack.org/cgit/openstack/openstack-ansible-tests/plain/test-ansible-deps.txt?h=stable/newton
[testenv:ansible]
basepython = python3
deps =
{[testenv]deps}
-r{toxinidir}/global-requirement-pins.txt
@ -111,6 +118,7 @@ deps =
[testenv:ansible-syntax]
basepython = python3
deps =
{[testenv:ansible]deps}
commands =
@ -119,6 +127,7 @@ commands =
[testenv:ansible-lint]
basepython = python3
deps =
{[testenv:ansible]deps}
commands =
@ -127,6 +136,7 @@ commands =
[testenv:inventory]
basepython = python3
# Use a fixed seed since some inventory tests rely on specific ordering
setenv =
{[testenv]setenv}
@ -152,6 +162,7 @@ commands =
[testenv:linters]
basepython = python3
deps =
{[testenv:docs]deps}
{[testenv:ansible]deps}