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: I4dd441f65a364eeccff217c99bf423540c44e3f5
This commit is contained in:
huang.zhiping 2018-06-09 11:07:49 +08:00 committed by Dobroslaw Zybort
parent c40c777ae1
commit 84fdd24d5d
1 changed files with 10 additions and 0 deletions

10
tox.ini
View File

@ -47,23 +47,27 @@ commands =
coverage xml -o cover/coverage.xml coverage xml -o cover/coverage.xml
[testenv:debug] [testenv:debug]
basepython = python3
description = Allows to run unit-test with debug mode enabled description = Allows to run unit-test with debug mode enabled
commands = commands =
{[testenv]commands} {[testenv]commands}
oslo_debug_helper -t {env:OS_TEST_PATH} {posargs} oslo_debug_helper -t {env:OS_TEST_PATH} {posargs}
[testenv:bashate] [testenv:bashate]
basepython = python3
description = Validates (pep8-like) devstack plugins description = Validates (pep8-like) devstack plugins
skip_install = True skip_install = True
usedevelop = False usedevelop = False
commands = bash {toxinidir}/tools/bashate.sh commands = bash {toxinidir}/tools/bashate.sh
[testenv:bandit] [testenv:bandit]
basepython = python3
skip_install = True skip_install = True
usedevelop = False usedevelop = False
commands = bandit -r monasca_events_api -n5 -x monasca_events_api/tests commands = bandit -r monasca_events_api -n5 -x monasca_events_api/tests
[testenv:flake8] [testenv:flake8]
basepython = python3
skip_install = True skip_install = True
usedevelop = False usedevelop = False
commands = commands =
@ -87,6 +91,7 @@ commands =
{[testenv:releasenotes]commands} {[testenv:releasenotes]commands}
[testenv:api-ref] [testenv:api-ref]
basepython = python3
description = Called from CI scripts to test and publish the API Ref description = Called from CI scripts to test and publish the API Ref
commands = commands =
rm -rf api-ref/build rm -rf api-ref/build
@ -101,6 +106,7 @@ commands =
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:devdocs] [testenv:devdocs]
basepython = python3
description = Builds developer documentation description = Builds developer documentation
commands = commands =
{[testenv]commands} {[testenv]commands}
@ -110,6 +116,7 @@ commands =
python setup.py build_sphinx python setup.py build_sphinx
[testenv:checkniceness] [testenv:checkniceness]
basepython = python3
description = Validates (pep-like) documentation description = Validates (pep-like) documentation
skip_install = True skip_install = True
usedevelop = False usedevelop = False
@ -119,6 +126,7 @@ commands =
doc8 --file-encoding utf-8 {toxinidir}/releasenotes doc8 --file-encoding utf-8 {toxinidir}/releasenotes
[testenv:checkjson] [testenv:checkjson]
basepython = python3
description = Validates all json samples inside doc folder description = Validates all json samples inside doc folder
deps = deps =
whitelist_externals = whitelist_externals =
@ -129,10 +137,12 @@ commands =
bash -c '! find doc/ -type f -name *.json | xargs -t -n1 python -m json.tool 2>&1 > /dev/null | grep -B1 -v ^python' bash -c '! find doc/ -type f -name *.json | xargs -t -n1 python -m json.tool 2>&1 > /dev/null | grep -B1 -v ^python'
[testenv:genconfig] [testenv:genconfig]
basepython = python3
description = Generates sample documentation file for monasca-events-api description = Generates sample documentation file for monasca-events-api
commands = oslo-config-generator --config-file=config-generator/config.conf commands = oslo-config-generator --config-file=config-generator/config.conf
[testenv:genpolicy] [testenv:genpolicy]
basepython = python3
description = Generates sample policy.yaml file for monasca-events-api description = Generates sample policy.yaml file for monasca-events-api
commands = oslopolicy-sample-generator --config-file=config-generator/policy.conf commands = oslopolicy-sample-generator --config-file=config-generator/policy.conf