[ty] Do not allow invalid virtual environments from discovered .venv or VIRTUAL_ENV#18003
Merged
[ty] Do not allow invalid virtual environments from discovered .venv or VIRTUAL_ENV#18003
.venv or VIRTUAL_ENV#18003Conversation
zanieb
commented
May 10, 2025
| impl SysPrefixPathOrigin { | ||
| /// Whether the given `sys.prefix` path must be a virtual environment (rather than a system | ||
| /// Python environment). | ||
| pub(crate) fn must_be_virtual_env(&self) -> bool { |
Member
Author
There was a problem hiding this comment.
We could also frame this as allows_system_environment — no strong feelings here, easy to change as needed in the future.
7066570 to
17c64dc
Compare
Contributor
|
AlexWaygood
approved these changes
May 10, 2025
17c64dc to
3439005
Compare
2f9a189 to
c9653c0
Compare
3439005 to
a96d060
Compare
…` or `VIRTUAL_ENV`
a96d060 to
b0d6ac0
Compare
Glyphack
pushed a commit
to Glyphack/ruff
that referenced
this pull request
May 21, 2025
…` or `VIRTUAL_ENV` (astral-sh#18003) Follow-up to astral-sh#17991 ensuring we do not allow detection of system environments when the origin is `VIRTUAL_ENV` or a discovered `.venv` directory — i.e., those always require a `pyvenv.cfg` file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #17991 ensuring we do not allow detection of system environments when the origin is
VIRTUAL_ENVor a discovered.venvdirectory — i.e., those always require apyvenv.cfgfile.