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: I3c8e5c663a3fd881430f84fc502e46192de77fc7
This commit is contained in:
huang.zhiping
2018-06-09 02:18:32 +08:00
parent e581bf7a3f
commit 0a668b16da

10
tox.ini
View File

@@ -16,6 +16,7 @@ deps = -r{toxinidir}/test-requirements.txt
commands = ostestr {posargs} commands = ostestr {posargs}
[testenv:functional] [testenv:functional]
basepython = python3
usedevelop = True usedevelop = True
# Define virtualenv directory, port to use for functional testing, and number # Define virtualenv directory, port to use for functional testing, and number
# of seconds to wait for the agent to come alive during functional testing. # of seconds to wait for the agent to come alive during functional testing.
@@ -28,6 +29,7 @@ setenv =
commands = ostestr {posargs} commands = ostestr {posargs}
[testenv:pep8] [testenv:pep8]
basepython = python3
whitelist_externals = bash whitelist_externals = bash
commands = commands =
flake8 {posargs:ironic_python_agent imagebuild} flake8 {posargs:ironic_python_agent imagebuild}
@@ -37,6 +39,7 @@ commands =
doc8 doc/source README.rst doc8 doc/source README.rst
[testenv:cover] [testenv:cover]
basepython = python3
setenv = VIRTUAL_ENV={envdir} setenv = VIRTUAL_ENV={envdir}
PYTHON=coverage run --source ironic_python_agent --omit='*tests*' --parallel-mode PYTHON=coverage run --source ironic_python_agent --omit='*tests*' --parallel-mode
commands = commands =
@@ -47,24 +50,29 @@ commands =
coverage html -d ./cover --omit='*tests*' coverage html -d ./cover --omit='*tests*'
[testenv:venv] [testenv:venv]
basepython = python3
setenv = PYTHONHASHSEED=0 setenv = PYTHONHASHSEED=0
commands = {posargs:} commands = {posargs:}
[testenv:debug] [testenv:debug]
basepython = python3
envdir = {toxworkdir}/venv envdir = {toxworkdir}/venv
commands = oslo_debug_helper -t ironic_python_agent/tests/unit {posargs} commands = oslo_debug_helper -t ironic_python_agent/tests/unit {posargs}
[testenv:devenv] [testenv:devenv]
basepython = python3
envdir = devenv envdir = devenv
usedevelop = True usedevelop = True
[testenv:docs] [testenv:docs]
basepython = python3
setenv = PYTHONHASHSEED=0 setenv = PYTHONHASHSEED=0
sitepackages = False sitepackages = False
commands = commands =
python setup.py build_sphinx python setup.py build_sphinx
[testenv:releasenotes] [testenv:releasenotes]
basepython = python3
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[flake8] [flake8]
@@ -86,12 +94,14 @@ enable-extensions=H106,H203,H204,H205,H210,H904
import_exceptions = ironic.openstack.common.gettextutils._,testtools.matchers import_exceptions = ironic.openstack.common.gettextutils._,testtools.matchers
[testenv:checkconfig] [testenv:checkconfig]
basepython = python3
sitepackages = False sitepackages = False
envdir = {toxworkdir}/venv envdir = {toxworkdir}/venv
commands = commands =
{toxinidir}/tools/config/check_uptodate.sh {toxinidir}/tools/config/check_uptodate.sh
[testenv:genconfig] [testenv:genconfig]
basepython = python3
sitepackages = False sitepackages = False
envdir = {toxworkdir}/venv envdir = {toxworkdir}/venv
commands = commands =