From 94034b91f967fa81b628ac498134f886ebed0a68 Mon Sep 17 00:00:00 2001 From: Al Bailey Date: Fri, 23 Dec 2022 14:46:01 +0000 Subject: [PATCH] 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 Change-Id: If8e339d20e57e0830ea4ce27c098bacfef2f2ef8 --- .zuul.yaml | 2 ++ controllerconfig/controllerconfig/tox.ini | 2 +- sysinv/cgts-client/cgts-client/tox.ini | 10 ++++++++-- sysinv/sysinv/sysinv/tox.ini | 7 ++++--- tox.ini | 16 ++++++++-------- tsconfig/tsconfig/tox.ini | 2 +- 6 files changed, 24 insertions(+), 15 deletions(-) diff --git a/.zuul.yaml b/.zuul.yaml index 82a8018e7c..817327b451 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -1,5 +1,7 @@ --- - project: + vars: + ensure_tox_version: '<4' templates: - publish-stx-docs - stx-api-ref-jobs diff --git a/controllerconfig/controllerconfig/tox.ini b/controllerconfig/controllerconfig/tox.ini index 8f4c5d6913..afa6079a96 100644 --- a/controllerconfig/controllerconfig/tox.ini +++ b/controllerconfig/controllerconfig/tox.ini @@ -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} \ diff --git a/sysinv/cgts-client/cgts-client/tox.ini b/sysinv/cgts-client/cgts-client/tox.ini index 0a37e18fe2..abd67cf97f 100644 --- a/sysinv/cgts-client/cgts-client/tox.ini +++ b/sysinv/cgts-client/cgts-client/tox.ini @@ -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 diff --git a/sysinv/sysinv/sysinv/tox.ini b/sysinv/sysinv/sysinv/tox.ini index 9d5b95dfe1..8cd445f777 100644 --- a/sysinv/sysinv/sysinv/tox.ini +++ b/sysinv/sysinv/sysinv/tox.ini @@ -4,17 +4,17 @@ minversion = 1.6 skipsdist = True # tox does not work if the path to the workdir is too long, so move it to /tmp -# tox 3.1.0 adds TOX_LIMITED_SHEBANG +# tox 3.1.0 adds TOX_LIMITED_SHEBANG toxworkdir = /tmp/{env:USER}_sysinvtox 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} diff --git a/tox.ini b/tox.ini index ff4658f3d4..63f35e0d7a 100644 --- a/tox.ini +++ b/tox.ini @@ -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 diff --git a/tsconfig/tsconfig/tox.ini b/tsconfig/tsconfig/tox.ini index 8a009704d9..d6cafafd50 100644 --- a/tsconfig/tsconfig/tox.ini +++ b/tsconfig/tsconfig/tox.ini @@ -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]