Pin tox to be less than 4

The dev environment used by some docs developers uses
an old version of tox, and does not support the
allowlist_externals entry required by tox 4.

The version of tox used by some other developers cannot
support tox.ini that contains both allowlist_externals and
whitelist_externals in the same file.

The fix for now is to stay with whitelist_externals and tox<4

This fix mostly reverts and re-works these two commits
https://review.opendev.org/c/starlingx/docs/+/869229
https://review.opendev.org/c/starlingx/docs/+/868621

Partial-Bug: #2000399

Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: Ib8a5eea5d27e7b7347bc717d11f9dc5a0be4f396
This commit is contained in:
Al Bailey 2023-01-13 13:48:38 +00:00 committed by Al Bailey
parent dc40df6818
commit 5c86db74c8
2 changed files with 10 additions and 10 deletions

View File

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

18
tox.ini
View File

@ -29,24 +29,24 @@ commands =
git restore doc/source/dist_cloud/kubernetes/* git restore doc/source/dist_cloud/kubernetes/*
bash hw-updates.sh bash hw-updates.sh
bash htmlChecks.sh doc/build/html bash htmlChecks.sh doc/build/html
allowlist_externals = bash
# Note: The dev env for the docs team uses a version of tox that does not yet support allowlist_externals
whitelist_externals = bash
htmlChecks.sh htmlChecks.sh
get-remote-files.sh get-remote-files.sh
git git
# hw-updates.sh # hw-updates.sh
whitelist_externals = {[testenv:docs]allowlist_externals}
[testenv:api-ref] [testenv:api-ref]
deps = {[testenv:docs]deps} deps = {[testenv:docs]deps}
commands = commands =
rm -rf api-ref/build rm -rf api-ref/build
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
allowlist_externals = rm whitelist_externals = rm
whitelist_externals = {[testenv:api-ref]allowlist_externals}
[testenv:linters] [testenv:linters]
allowlist_externals = bash whitelist_externals = bash
whitelist_externals = {[testenv:linters]allowlist_externals}
commands = commands =
bash -c "find {toxinidir} \ bash -c "find {toxinidir} \
\( -name .tox -prune \) \ \( -name .tox -prune \) \
@ -64,16 +64,14 @@ passenv=PWD
commands = commands =
bash -c "echo Running in {env:PWD}" bash -c "echo Running in {env:PWD}"
bash new-topic.sh {env:PWD} {toxinidir} bash new-topic.sh {env:PWD} {toxinidir}
allowlist_externals = new-topic.sh whitelist_externals = new-topic.sh
bash bash
whitelist_externals = {[testenv:newfile]allowlist_externals}
[testenv:picks] [testenv:picks]
commands = commands =
./pickCompare.sh ./pickCompare.sh
allowlist_externals = pickCompare.sh whitelist_externals = pickCompare.sh
bash bash
whitelist_externals = {[testenv:picks]allowlist_externals}
[testenv:linkcheck] [testenv:linkcheck]