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: If3aad2663d76fce58430d3b6ee6220ff550977a3
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
Doug Hellmann 2018-06-06 16:05:58 -04:00
parent 105d89e9ec
commit a62fbca594
1 changed files with 13 additions and 0 deletions

13
tox.ini
View File

@ -34,11 +34,13 @@ commands =
stestr slowest stestr slowest
[testenv:py35] [testenv:py35]
basepython = python3
commands = commands =
{[testenv]commands} {[testenv]commands}
stestr run '{posargs}' stestr run '{posargs}'
[testenv:docs] [testenv:docs]
basepython = python3
deps = deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
-r{toxinidir}/requirements.txt -r{toxinidir}/requirements.txt
@ -46,6 +48,7 @@ deps =
commands = sphinx-build -W -b html doc/source doc/build/html commands = sphinx-build -W -b html doc/source doc/build/html
[testenv:cover] [testenv:cover]
basepython = python3
commands = commands =
coverage erase coverage erase
find . -type f -name "*.pyc" -delete find . -type f -name "*.pyc" -delete
@ -53,15 +56,18 @@ commands =
coverage report coverage report
[testenv:bandit] [testenv:bandit]
basepython = python3
deps = -r{toxinidir}/test-requirements.txt deps = -r{toxinidir}/test-requirements.txt
commands = bandit -r designate -n5 -x tests -t \ commands = bandit -r designate -n5 -x tests -t \
B111,B505,B504,B503,B502,B501,B604,B605,B001,B601,B602,B701,B609,B702,\ B111,B505,B504,B503,B502,B501,B604,B605,B001,B601,B602,B701,B609,B702,\
B608,B506,B312,B310,B411,B109,B108,B103,B102,B309,B308,B302,B307,B306 B608,B506,B312,B310,B411,B109,B108,B103,B102,B309,B308,B302,B307,B306
[testenv:debug] [testenv:debug]
basepython = python3
commands = oslo_debug_helper -t designate/tests {posargs} commands = oslo_debug_helper -t designate/tests {posargs}
[testenv:flake8] [testenv:flake8]
basepython = python3
deps = -r{toxinidir}/test-requirements.txt deps = -r{toxinidir}/test-requirements.txt
commands = sh tools/pretty_flake8.sh commands = sh tools/pretty_flake8.sh
{[testenv:bandit]commands} {[testenv:bandit]commands}
@ -74,12 +80,15 @@ commands = sh tools/pretty_flake8.sh
doc8 {posargs} doc8 {posargs}
[testenv:genconfig] [testenv:genconfig]
basepython = python3
commands = oslo-config-generator --config-file=etc/designate/designate-config-generator.conf commands = oslo-config-generator --config-file=etc/designate/designate-config-generator.conf
[testenv:genpolicy] [testenv:genpolicy]
basepython = python3
commands = oslopolicy-sample-generator --config-file etc/designate/designate-policy-generator.conf commands = oslopolicy-sample-generator --config-file etc/designate/designate-policy-generator.conf
[testenv:bashate] [testenv:bashate]
basepython = python3
deps = bashate deps = bashate
whitelist_externals = bash whitelist_externals = bash
commands = bash -c "find {toxinidir}/devstack \ commands = bash -c "find {toxinidir}/devstack \
@ -97,6 +106,7 @@ commands = bash -c "find {toxinidir}/devstack \
-print0 | xargs -0 bashate -v" -print0 | xargs -0 bashate -v"
[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-missing-reqs must be installed separately, outside # this also means that pip-missing-reqs must be installed separately, outside
@ -106,6 +116,7 @@ deps = pip-check-reqs
commands=pip-missing-reqs -d --ignore-file=designate/tests/* designate commands=pip-missing-reqs -d --ignore-file=designate/tests/* designate
[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.
# #
@ -117,6 +128,7 @@ commands =
sphinx-build -E -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html sphinx-build -E -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
[testenv:releasenotes] [testenv:releasenotes]
basepython = python3
deps = deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
-r{toxinidir}/requirements.txt -r{toxinidir}/requirements.txt
@ -124,6 +136,7 @@ deps =
commands = sphinx-build -a -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html commands = sphinx-build -a -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:venv] [testenv:venv]
basepython = python3
commands = {posargs} commands = {posargs}
[doc8] [doc8]