From cbd96b13fee20a957109125730baaca4f8d9f301 Mon Sep 17 00:00:00 2001 From: "huang.zhiping" Date: Fri, 8 Jun 2018 14:07:37 +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: I0f865164b2e02577d5e57fc1fef836584dc627ea --- tox.ini | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 1f5b246b..837f50b0 100644 --- a/tox.ini +++ b/tox.ini @@ -3,12 +3,13 @@ envlist = py35,pep8,bandit [testenv] setenv = YAMLDIR = {toxinidir}/tests/yaml_samples/ -basepython=python3.5 +basepython=python3 deps= -rrequirements-lock.txt -rrequirements-test.txt [testenv:freeze] +basepython=python3 whitelist_externals= rm sh @@ -19,6 +20,7 @@ commands= sh -c "pip freeze --all | grep -v 'drydock-provisioner|pyinotify|pkg-resources==0.0.0' > requirements-lock.txt" [testenv:yapf] +basepython=python3 whitelist_externals=find commands= yapf -i -r --style=pep8 {toxinidir}/setup.py @@ -28,6 +30,7 @@ commands= find {toxinidir}/drydock_provisioner -name '__init__.py' -exec yapf -i --style=pep8 \{\} ; [testenv:py35] +basepython=python3 usedevelop=True setenv= PYTHONWARNING=all @@ -38,6 +41,7 @@ commands= {toxinidir}/tests/unit/{posargs} [testenv:integration] +basepython=python3.5 passenv=DOCKER_REGISTRY IMAGE_NAME IMAGE_PREFIX IMAGE_TAG setenv= PYTHONWARNING=all @@ -48,6 +52,7 @@ commands= {toxinidir}/tests/integration/postgres/{posargs} [testenv:cover] +basepython=python3 usedevelop=True passenv=DOCKER_REGISTRY IMAGE_NAME IMAGE_PREFIX IMAGE_TAG setenv= @@ -58,20 +63,24 @@ commands= {toxinidir}/tests/unit/ {toxinidir}/tests/integration/postgres [testenv:genconfig] +basepython=python3 whitelist_externals=tee sh commands = sh -c 'oslo-config-generator --config-file=etc/drydock/drydock-config-generator.conf | tee etc/drydock/drydock.conf.sample docs/source/_static/drydock.conf.sample' [testenv:genpolicy] +basepython=python3 whitelist_externals=tee sh commands = sh -c 'oslopolicy-sample-generator --config-file etc/drydock/drydock-policy-generator.conf | tee etc/drydock/policy.yaml.sample docs/source/_static/policy.yaml.sample' [testenv:pep8] +basepython=python3 commands = flake8 \ {posargs} [testenv:bandit] +basepython=python3 commands = bandit -r drydock_provisioner -n 5 [flake8] @@ -80,6 +89,7 @@ exclude= venv,.venv,.git,.idea,.tox,*.egg-info,*.eggs,bin,dist,./build/,alembic/ max-line-length=119 [testenv:docs] +basepython=python3 deps= -rdocs/requirements-doc.txt whitelist_externals=rm