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: I24b87db5bd80876ff631698350606aa4e23919ee
Closes-Bug:  #1802032
Signed-off-by:  98k <18552437190@163.com>
This commit is contained in:
98k 2018-10-05 10:34:55 +00:00 committed by Filippo Inzaghi
parent 7c1c082be0
commit 9a976a61c3
1 changed files with 6 additions and 1 deletions

View File

@ -16,7 +16,6 @@ configutilities_src_dir = ../stx-config/configutilities/configutilities
cgtsclient_src_dir = ../stx-config/sysinv/cgts-client/cgts-client cgtsclient_src_dir = ../stx-config/sysinv/cgts-client/cgts-client
[testenv] [testenv]
basepython = python3
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/pike} {opts} {packages} install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/pike} {opts} {packages}
setenv = setenv =
VIRTUAL_ENV={envdir} VIRTUAL_ENV={envdir}
@ -83,10 +82,12 @@ basepython = python3.4
commands = oslo_debug_helper {posargs} commands = oslo_debug_helper {posargs}
[testenv:pep8] [testenv:pep8]
basepython = python3
deps = hacking<0.11,>=0.10.2 deps = hacking<0.11,>=0.10.2
commands = flake8 commands = flake8
[testenv:venv] [testenv:venv]
basepython = python3
commands = {posargs} commands = {posargs}
[testenv:cover] [testenv:cover]
@ -119,6 +120,7 @@ commands =
whitelist_externals = rm whitelist_externals = rm
[testenv:newnote] [testenv:newnote]
basepython = python3
# Re-use the releasenotes venv # Re-use the releasenotes venv
envdir = {toxworkdir}/releasenotes envdir = {toxworkdir}/releasenotes
deps = -r{toxinidir}/doc/requirements.txt deps = -r{toxinidir}/doc/requirements.txt
@ -134,6 +136,7 @@ commands =
whitelist_externals = rm whitelist_externals = rm
[testenv:debug] [testenv:debug]
basepython = python3
commands = oslo_debug_helper {posargs} commands = oslo_debug_helper {posargs}
[flake8] [flake8]
@ -144,6 +147,7 @@ builtins = _
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build
[testenv:genconfig] [testenv:genconfig]
basepython = python3
commands = commands =
oslo-config-generator --config-file=tools/config-generator.conf oslo-config-generator --config-file=tools/config-generator.conf
@ -160,6 +164,7 @@ commands =
pylint {posargs} dcmanager dcorch --rcfile=./pylint.rc pylint {posargs} dcmanager dcorch --rcfile=./pylint.rc
[testenv:linters] [testenv:linters]
basepython = python3
# bashate ignore: # bashate ignore:
# E006 - accept long lines # E006 - accept long lines
# E040 - false positive on |& syntax (new in bash 4) # E040 - false positive on |& syntax (new in bash 4)