Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix regression in check for stale environments #425

Merged
merged 18 commits into from
May 23, 2021

Conversation

cjolowicz
Copy link
Collaborator

Fixes #424

- `sys.real_prefix` was set by virtualenv < 20.0.
- `sys.base_prefix` is used by virtualenv >= 20.0 and python -m venv (PEP 405)
When comparing the resolved interpreter to the interpreter in an existing
virtualenv, we need to use sys.base_prefix (or sys.real_prefix) for both.
The resolved interpreter is located in the virtualenv, so its sys.prefix would
point into the virtualenv instead of the base installation.

This bug results in virtualenvs never being reused.
Environments created by virtualenv < 20.0.0 do not have pyvenv.cfg files.
@cjolowicz cjolowicz requested a review from theacodes May 23, 2021 17:16
@theacodes
Copy link
Collaborator

Thanks for fixing this (and adding tests to cover the regression!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants