Update tox.ini to work with tox 4

This change will allow this repo to pass zuul now
that this has merged:
https://review.opendev.org/c/zuul/zuul-jobs/+/866943

Tox 4 deprecated whitelist_externals.
Replace whitelist_externals with allowlist_externals
Tox 4 Fail on pass_env/passenv entries containing whitespace.
Updated passenv with comma separated values
Closes-Bug: #2000727

Change-Id: I48859d5a1c8242a6a7d049c96f8dcabbf4c7c044
This commit is contained in:
Vasudeo Nimbekar 2022-12-29 17:43:45 +05:30
parent d035624153
commit b30ff6f955
1 changed files with 17 additions and 7 deletions

24
tox.ini
View File

@ -1,7 +1,6 @@
[tox]
envlist = py3,pep8
minversion = 2.0
skipsdist = True
ignore_basepython_conflict = True
[testenv]
@ -11,7 +10,13 @@ install_command = pip install {opts} {packages}
setenv = VIRTUAL_ENV={envdir}
PYTHONDONTWRITEBYTECODE = 1
PYTHONWARNINGS=default::DeprecationWarning
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
passenv =
http_proxy
HTTP_PROXY
https_proxy
HTTPS_PROXY
no_proxy
NO_PROXY
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/test-requirements.txt
@ -22,19 +27,23 @@ commands =
rm -f .testrepository/times.dbm
find . -type f -name "*.pyc" -delete
stestr run --slowest {posargs}
whitelist_externals =
allowlist_externals =
rm
find
[testenv:unit-postgresql]
setenv = VIRTUAL_ENV={envdir}
passenv = ZUUL_PROJECT
commands = ./run_tests.sh -N --db-type postgresql
allowlist_externals =
bash
commands = bash run_tests.sh -N --db-type postgresql
[testenv:unit-mysql]
setenv = VIRTUAL_ENV={envdir}
passenv = ZUUL_PROJECT
commands = ./run_tests.sh -N --db-type mysql
allowlist_externals =
bash
commands = bash run_tests.sh -N --db-type mysql
[testenv:pep8]
commands =
@ -80,7 +89,7 @@ commands =
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/doc/requirements.txt
whitelist_externals =
allowlist_externals =
make
commands =
sphinx-build -W -b latex doc/source doc/build/pdf
@ -97,7 +106,8 @@ commands =
commands =
rm -rf api-ref/build
sphinx-build -W --keep-going -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
whitelist_externals = rm
allowlist_externals =
rm
#Skip PEP257 violation.
[flake8]