**Context**
T345152 is for the CI job on`operations/puppet` not noticing changes made to the requirements file. The reason is the container image has the requirements pre installed (by running `tox --notest` when building the image) and tox version 3 was unable to detect changes ([[ https://github.com/tox-dev/tox/issues/149 | tox #149 ]]) which is addressed by tox version 4 which is a major rewrite.
I have upgraded all images to use tox (and attached patches to T345152), but being a major rewrite, there are more than a few fixes needed. Some indications are listed at upstream guide [[ https://tox.wiki/en/latest/upgrading.html | Upgrading to tox v4 ]].
Some issues I have noticed so far:
* `tox:jenkins` is no more supported (T345607)
* `whitelist_externals` is no more recognized and should be replaced by `allowlist_externals`
* Python 2.7 is no more recognized since tox delegates the discovery to virtualenv. That has been addressed by pinning virtualenv to `20.21.1`.
* Comments in `tox.ini` are handled differently, notably it does not recognized an indented comment in a multilne option such as:
```
lang=ini,name=tox.ini
[flake8]
extend_ignore =
# expected 2 blank lines, found 1
E302
```
`# expected 2 blank lines, found 1` ends up being passed as is. The fix is to deindent it in order for tox to recognize it as a comment :)
This task is to track fallout and adjustments to be made to any affected repositories.