tox: Trivial cleanup

1. refactor basepython to testenv
2. remove py27 target
3. fix a bug that prevented usage of upper constraints in some test envs

Change-Id: I5fcec1c7ec978f9fb279de8ac9aae227e6ec5e9d
This commit is contained in:
caoyuan 2019-12-22 23:43:10 +08:00
parent 69d9372016
commit 286559f626
1 changed files with 11 additions and 15 deletions

26
tox.ini
View File

@ -1,9 +1,10 @@
[tox]
minversion = 2.0
envlist = py27,py37,pep8
minversion = 3.1
envlist = py37,pep8
ignore_basepython_conflict = True
[testenv]
install_command = pip install {opts} {packages}
basepython = python3
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/test-requirements.txt
@ -15,12 +16,9 @@ commands =
stestr run --slowest (?!tests.test_functional_eventlet)tests {posargs}
env TEST_EVENTLET=1 stestr run --slowest tests.test_functional_eventlet
[testenv:py27]
basepython = python2.7
[testenv:pep8]
basepython = python3
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/test-requirements.txt
commands =
flake8
@ -28,7 +26,6 @@ commands =
bandit -r oslo_rootwrap tests -n5 --skip B404
[testenv:cover]
basepython = python3
deps = {[testenv]deps}
coverage
setenv =
@ -40,13 +37,13 @@ commands =
coverage xml -o cover/coverage.xml
[testenv:venv]
basepython = python3
commands = {posargs}
[testenv:docs]
basepython = python3
whitelist_externals = rm
deps = -r{toxinidir}/doc/requirements.txt
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/doc/requirements.txt
commands =
rm -fr doc/build
sphinx-build -W --keep-going -b html doc/source doc/build/html
@ -63,19 +60,18 @@ basepython = python2.7
commands = python benchmark/benchmark.py
[testenv:benchmark3]
basepython = python3
commands = python3 benchmark/benchmark.py
[testenv:releasenotes]
basepython = python3
whitelist_externals = rm
deps = -r{toxinidir}/doc/requirements.txt
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/doc/requirements.txt
commands =
rm -rf releasenotes/build
sphinx-build -a -E -W -d releasenotes/build/doctrees --keep-going -b html releasenotes/source releasenotes/build/html
[testenv:lower-constraints]
basepython = python3
deps =
-c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt