From 84fdd24d5d270c566ddb54e5a247f2054874eb9a Mon Sep 17 00:00:00 2001 From: "huang.zhiping" Date: Sat, 9 Jun 2018 11:07:49 +0800 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: I4dd441f65a364eeccff217c99bf423540c44e3f5 --- tox.ini | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tox.ini b/tox.ini index 5d8f70e..e7f04c4 100644 --- a/tox.ini +++ b/tox.ini @@ -47,23 +47,27 @@ commands = coverage xml -o cover/coverage.xml [testenv:debug] +basepython = python3 description = Allows to run unit-test with debug mode enabled commands = {[testenv]commands} oslo_debug_helper -t {env:OS_TEST_PATH} {posargs} [testenv:bashate] +basepython = python3 description = Validates (pep8-like) devstack plugins skip_install = True usedevelop = False commands = bash {toxinidir}/tools/bashate.sh [testenv:bandit] +basepython = python3 skip_install = True usedevelop = False commands = bandit -r monasca_events_api -n5 -x monasca_events_api/tests [testenv:flake8] +basepython = python3 skip_install = True usedevelop = False commands = @@ -87,6 +91,7 @@ commands = {[testenv:releasenotes]commands} [testenv:api-ref] +basepython = python3 description = Called from CI scripts to test and publish the API Ref commands = 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 [testenv:devdocs] +basepython = python3 description = Builds developer documentation commands = {[testenv]commands} @@ -110,6 +116,7 @@ commands = python setup.py build_sphinx [testenv:checkniceness] +basepython = python3 description = Validates (pep-like) documentation skip_install = True usedevelop = False @@ -119,6 +126,7 @@ commands = doc8 --file-encoding utf-8 {toxinidir}/releasenotes [testenv:checkjson] +basepython = python3 description = Validates all json samples inside doc folder deps = 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' [testenv:genconfig] +basepython = python3 description = Generates sample documentation file for monasca-events-api commands = oslo-config-generator --config-file=config-generator/config.conf [testenv:genpolicy] +basepython = python3 description = Generates sample policy.yaml file for monasca-events-api commands = oslopolicy-sample-generator --config-file=config-generator/policy.conf