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: I03574b12fc9ef07ce459e81c9b8219a3b10bd4da
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
Doug Hellmann 2018-06-06 16:06:04 -04:00 committed by Luigi Toscano
parent 4c5fab8e37
commit ebda88534a
1 changed files with 12 additions and 0 deletions

12
tox.ini
View File

@ -16,6 +16,7 @@ commands = ostestr {posargs}
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
[testenv:cover]
basepython = python3
commands = {toxinidir}/tools/cover.sh {posargs}
[testenv:debug-py27]
@ -27,6 +28,7 @@ basepython = python3.5
commands = oslo_debug_helper -t sahara/tests/unit {posargs}
[testenv:pep8]
basepython = python3
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
-r{toxinidir}/requirements.txt
@ -42,9 +44,11 @@ commands =
bandit -c bandit.yaml -r sahara -n5 -p sahara_default -x tests
[testenv:genpolicy]
basepython = python3
commands = oslopolicy-sample-generator --config-file tools/config/sahara-policy-generator.conf
[testenv:venv]
basepython = python3
commands = {posargs}
[testenv:images]
@ -52,6 +56,7 @@ sitepackages = True
commands = {posargs}
[testenv:docs]
basepython = python3
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
-r{toxinidir}/doc/requirements.txt
@ -65,6 +70,7 @@ commands =
whitelist_externals = rm
[testenv:api-ref]
basepython = python3
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
-r{toxinidir}/doc/requirements.txt
@ -76,15 +82,18 @@ whitelist_externals = rm
[testenv:pylint]
basepython = python3
setenv = VIRTUAL_ENV={envdir}
commands = bash tools/lintstack.sh
[testenv:genconfig]
basepython = python3
commands =
oslo-config-generator --config-file tools/config/config-generator.sahara.conf \
--output-file etc/sahara/sahara.conf.sample
[testenv:releasenotes]
basepython = python3
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
-r{toxinidir}/doc/requirements.txt
@ -94,6 +103,7 @@ commands =
whitelist_externals = rm
[testenv:debug]
basepython = python3
# It runs tests from the specified dir (default is sahara/tests)
# in interactive mode, so, you could use pbr for tests debug.
# Example usage: tox -e debug -- -t sahara/tests/unit some.test.path
@ -101,6 +111,7 @@ whitelist_externals = rm
commands = oslo_debug_helper -t sahara/tests/unit {posargs}
[testenv:bandit]
basepython = python3
deps = -r{toxinidir}/test-requirements-bandit.txt
commands = bandit -c bandit.yaml -r sahara -n5 -p sahara_default -x tests
@ -120,6 +131,7 @@ import_exceptions = sahara.i18n
local-check-factory = sahara.utils.hacking.checks.factory
[testenv:bindep]
basepython = python3
# Do not install any requirements. We want this to be fast and work even if
# system dependencies are missing, since it's used to tell you what system
# dependencies are missing! This also means that bindep must be installed