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: I31a207868c07e08ae27c14635d52506021032cb7
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
Doug Hellmann 2018-06-06 14:50:06 -04:00
parent 06b64aea94
commit 69b23ef7de

View File

@ -3,7 +3,6 @@ minversion = 2.0
envlist = py35,py27,pep8 envlist = py35,py27,pep8
[testenv] [testenv]
basepython = python3
install_command = pip install {opts} {packages} install_command = pip install {opts} {packages}
whitelist_externals = bash whitelist_externals = bash
env env
@ -26,6 +25,7 @@ commands =
passenv = OS_TEST_DBAPI_ADMIN_CONNECTION passenv = OS_TEST_DBAPI_ADMIN_CONNECTION
[testenv:sqla_09] [testenv:sqla_09]
basepython = python3
commands = pip install SQLAlchemy>=0.9.0,!=0.9.5,<1.0.0 commands = pip install SQLAlchemy>=0.9.0,!=0.9.5,<1.0.0
python setup.py testr --slowest --testr-args='{posargs}' python setup.py testr --slowest --testr-args='{posargs}'
@ -36,24 +36,29 @@ commands =
env TEST_EVENTLET=1 bash tools/pretty_tox.sh '{posargs}' env TEST_EVENTLET=1 bash tools/pretty_tox.sh '{posargs}'
[testenv:pep8] [testenv:pep8]
basepython = python3
commands = commands =
flake8 flake8
# Run security linter # Run security linter
bandit -r oslo_db -x tests -n5 --skip B105,B311 bandit -r oslo_db -x tests -n5 --skip B105,B311
[testenv:venv] [testenv:venv]
basepython = python3
commands = {posargs} commands = {posargs}
[testenv:cover] [testenv:cover]
basepython = python3
commands = python setup.py test --coverage --coverage-package-name=oslo_db --testr-args='{posargs}' commands = python setup.py test --coverage --coverage-package-name=oslo_db --testr-args='{posargs}'
[testenv:docs] [testenv:docs]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt deps = -r{toxinidir}/doc/requirements.txt
commands = commands =
doc8 -e .rst CONTRIBUTING.rst HACKING.rst README.rst doc/source doc8 -e .rst CONTRIBUTING.rst HACKING.rst README.rst doc/source
sphinx-build -b html doc/source doc/build/html sphinx-build -b html doc/source doc/build/html
[testenv:releasenotes] [testenv:releasenotes]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt deps = -r{toxinidir}/doc/requirements.txt
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
@ -68,6 +73,7 @@ import_exceptions =
oslo_db._i18n oslo_db._i18n
[testenv:lower-constraints] [testenv:lower-constraints]
basepython = python3
deps = deps =
-c{toxinidir}/lower-constraints.txt -c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt -r{toxinidir}/test-requirements.txt