Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix provisioning from pyvenv interpreter #1452
The bug is related to #148.
When the original interpreter  tox is called with is actually a pyvenv
If tox configuration specifies
After setting up  tox will delegate the original call to it by spawning
It would also pass the value of
The fix is to make sure that when  spawns ,
(also see CONTRIBUTING.rst for details)
When the original interpreter  tox is called with is actually a pyvenv it will set the `__PYVENV_LAUNCHER__` environment variable to the path of pyvenv interpreter. If tox configuration specifies `requires` and the requirements are not satifsfied by , tox will create an intermediate virtual environment . After setting up  tox will delegate the original call by spawning a new  interpreter with the identical identical list of arguments. It will also pass the value of `__PYVENV_LAUNCHER__` if present. This in turn causes `sys.executable` to resolve to  instead of  therefore ignoring all modifications including installed requirements. The fix is to make sure that when  spawns , `__PYVENV_LAUNCHER__` is removed from the environment.
asottile left a comment
lg2m, pre-commit has the same code: https://github.com/pre-commit/pre-commit/blob/0fd4a2ea38df4f276e43397e21ecb3fcbc96d122/pre_commit/main.py#L32-L36
shakesfist framework builds
This now has been released under https://tox.readthedocs.io/en/latest/changelog.html#v3-14-1-2019-11-13