tox
tox copied to clipboard
tox4: clarify when an environment gets recreated
In https://github.com/tox-dev/tox/blame/rewrite/docs/user_guide.rst#L64 you can read:
If certain aspects of the project change, a re-creation of the environment is automatically triggered.
It would be great to add e.g. a footnote and clarify what exactly needs to change, and maybe also give an example when it does not get recreated, but maybe a user would expect it (e.g. what happens when a requirements.txt changes?).
Yeah. This is very a multi-faceted topic:
- for most env traits excluding dependencies (virtualenv version, base python version, etc) all change is a recreate,
- for dependencies, the rule of thumb here is that if you add dependencies to the project (either via deps/requirements.txt/constraints.txt etc), we'll not recreate just run the install again; if you remove dependencies we force a recreate.
Generally, the idea is that if we know for almost sure that we can update the tox environment from the current state to the desired state, we'll not recreate it. If we can't tell for sure we force a recreate.
I think this question (my question :-) ) is sufficiently answered by https://github.com/tox-dev/tox/blame/main/docs/faq.rst#L140-L144