From 05542392bd16cc632ef35fa1091c56f1bdd8eebe Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Wed, 6 Jun 2018 16:06:04 -0400 Subject: [PATCH] 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 --- tox.ini | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tox.ini b/tox.ini index 0544c3f..73dec7e 100644 --- a/tox.ini +++ b/tox.ini @@ -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