From 286559f626067c67e875d259efa2b9ab9e9a9a07 Mon Sep 17 00:00:00 2001 From: caoyuan Date: Sun, 22 Dec 2019 23:43:10 +0800 Subject: [PATCH] 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 --- tox.ini | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/tox.ini b/tox.ini index 53ab2b5..92e31f3 100644 --- a/tox.ini +++ b/tox.ini @@ -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