From 18197c5fed2c42931df85e2cd1835485d7516a12 Mon Sep 17 00:00:00 2001 From: "huang.zhiping" Date: Fri, 8 Jun 2018 14:15:25 +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: I43b21411d01290ddea7ca5fe11d70e970bf65bb3 --- tox.ini | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 545df4f..fb1092b 100644 --- a/tox.ini +++ b/tox.ini @@ -4,6 +4,7 @@ minversion = 1.6 skipsdist = True [testenv] +basepython = python3 setenv = VIRTUAL_ENV={envdir} usedevelop = True whitelist_externals = rm @@ -15,6 +16,7 @@ commands = rm -f .testrepository/times.dbm [testenv:functional] +basepython = python3 setenv = OS_TEST_PATH=./apmec/tests/functional deps = {[testenv]deps} @@ -36,6 +38,7 @@ deps = sitepackages = True [testenv:debug] +basepython = python3 commands = oslo_debug_helper {posargs} [testenv:debug-py27] @@ -56,6 +59,7 @@ commands = whitelist_externals = bash [testenv:i18n] +basepython = python3 commands = python ./tools/check_i18n.py ./apmec ./tools/i18n_cfg.py [testenv:docs] @@ -65,6 +69,7 @@ commands = python setup.py build_sphinx [testenv:api-ref] +basepython = python3 # This environment is called from CI scripts to test and publish # the API Ref to developer.openstack.org. commands = @@ -73,11 +78,12 @@ commands = whitelist_externals = rm [testenv:releasenotes] +basepython = python3 commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html - [testenv:cover] +basepython = python3 # Also do not run test_coverage_ext tests while gathering coverage as those # tests conflict with coverage. commands = @@ -86,6 +92,7 @@ commands = coverage report [testenv:venv] +basepython = python3 commands = {posargs} [flake8] @@ -101,10 +108,12 @@ import_exceptions = apmec._i18n local-check-factory = apmec.hacking.checks.factory [testenv:config-gen] +basepython = python3 commands = oslo-config-generator --config-file=etc/config-generator.conf [testenv:lower-constraints] +basepython = python3 deps = -c{toxinidir}/lower-constraints.txt -r{toxinidir}/test-requirements.txt