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

skipsdist and usedevelop are incompatible in tox 4.
Setting tox < 4 in .zuul.yaml rather than trying to
figure out why the sysinv component is not properly
installing in tox.

Partial-Bug: #1997255

Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: If8e339d20e57e0830ea4ce27c098bacfef2f2ef8
This commit is contained in:
Al Bailey 2022-12-23 14:46:01 +00:00
parent 0cf17cac5c
commit 94034b91f9
6 changed files with 24 additions and 15 deletions

View File

@ -1,5 +1,7 @@
---
- project:
vars:
ensure_tox_version: '<4'
templates:
- publish-stx-docs
- stx-api-ref-jobs

View File

@ -10,7 +10,7 @@ toxworkdir = /tmp/{env:USER}_cctox
stxdir = {toxinidir}/../../..
[testenv]
whitelist_externals = find
allowlist_externals = find
install_command = pip install \
--no-cache-dir \
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/stable/stein/upper-constraints.txt} \

View File

@ -26,11 +26,17 @@ deps = -r{toxinidir}/requirements.txt
commands =
find {toxinidir} -not -path '{toxinidir}/.tox/*' -name '*.py[c|o]' -delete
whitelist_externals =
allowlist_externals =
bash
find
rm
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
[testenv:py27]
basepython = python2.7

View File

@ -10,11 +10,11 @@ stxdir = {toxinidir}/../../../..
distshare={toxworkdir}/.tox/distshare
[testenv]
usedevelop = True
basepython = python3
usedevelop = True
# tox is silly... these need to be separated by a newline....
whitelist_externals = bash
allowlist_externals = bash
find
install_command = pip install -v -v -v \
@ -119,6 +119,7 @@ commands =
[testenv:py39]
basepython = python3.9
install_command = pip install -v -v -v \
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/starlingx/root/raw/branch/master/build-tools/requirements/debian/upper-constraints.txt} \
{opts} {packages}

16
tox.ini
View File

@ -12,12 +12,12 @@ setenv = VIRTUAL_ENV={envdir}
OS_STDERR_CAPTURE=1
OS_TEST_TIMEOUT=60
deps = -r{toxinidir}/test-requirements.txt
whitelist_externals = reno
allowlist_externals = reno
[testenv:bashate]
basepython = python3
whitelist_externals = bash
allowlist_externals = bash
# The following are suppressed:
# E006 Line too long
# E010 The "do" should be on same line as for
@ -52,7 +52,7 @@ commands =
[testenv:yamllint]
basepython = python3
whitelist_externals = bash
allowlist_externals = bash
commands =
bash -c "find {toxinidir} \
-name .tox -prune \
@ -62,7 +62,7 @@ commands =
[testenv:shellcheck]
basepython = python3
whitelist_externals = bash
allowlist_externals = bash
# The following shellcheck errors are suppressed:
# SC1091: Not following: ./bin/activate was not specified as input (see shellcheck -x).
# SC2001: See if you can use ${variable//search/replace} instead.
@ -139,7 +139,7 @@ commands =
[testenv:linters]
basepython = python3
whitelist_externals = bash
allowlist_externals = bash
commands =
{[testenv:bashate]commands}
{[testenv:yamllint]commands}
@ -176,7 +176,7 @@ deps = -r{toxinidir}/doc/requirements.txt
commands =
rm -rf api-ref/build
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
whitelist_externals = rm
allowlist_externals = rm
[testenv:docs]
basepython = python3
@ -185,7 +185,7 @@ deps = -r{toxinidir}/doc/requirements.txt
commands =
rm -rf doc/build
sphinx-build -a -E -W -d doc/build/doctrees -b html doc/source doc/build/html
whitelist_externals = rm
allowlist_externals = rm
[testenv:releasenotes]
basepython = python3
@ -194,7 +194,7 @@ deps = -r{toxinidir}/doc/requirements.txt
commands =
rm -rf releasenotes/build
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
whitelist_externals = rm
allowlist_externals = rm
[testenv:newnote]
basepython = python3

View File

@ -22,7 +22,7 @@ deps = -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
whitelist_externals = find
allowlist_externals = find
sh
[testenv:stestr]