Skip to content

Commit

Permalink
Avoid recreation of virtualenv due to symlinks
Browse files Browse the repository at this point in the history
If people called tox alternating between `python3 -m tox` and `tox`,
they would endup triggering venv recreation, even if there was only
one python. We should always resolve symlinks to avoid such false
env invalidations.
  • Loading branch information
ssbarnea committed Dec 1, 2022
1 parent 6fe6e4d commit 3602420
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/changelog/2574.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Resolve symlinks when saving Python executable path - by :user:`ssbarnea`.
2 changes: 1 addition & 1 deletion src/tox/tox_env/python/virtual_env/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def _get_python(self, base_python: list[str]) -> PythonInfo | None: # noqa: U10
version=interpreter.version,
is_64=(interpreter.architecture == 64),
platform=interpreter.platform,
extra={"executable": Path(interpreter.system_executable)},
extra={"executable": Path(interpreter.system_executable).resolve()},
)

def prepend_env_var_path(self) -> list[Path]:
Expand Down

0 comments on commit 3602420

Please sign in to comment.