-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[red-knot] Add support for --system-site-packages
virtual environments
#12759
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
1b47232
Implement parsing for `pyvenv.cfg` files
AlexWaygood 87c0fd6
Use `pyvenv.cfg` files to add system `site-packages` as an additional…
AlexWaygood 61c9036
Address review
AlexWaygood 40b9ea8
Address many review comments
AlexWaygood e213bb1
Improve `pyvenv.cfg` parsing
AlexWaygood 08eac4f
Add a comment
AlexWaygood d4c933a
rework the testing strategy
AlexWaygood fe1ceb1
Use `PythonVersion` from `red_knot_python_semantic`
AlexWaygood 535a68d
Maybe fix Windows?
AlexWaygood bc86a4e
error handling improvements
AlexWaygood 27099e8
More docs for `PythonHomePath`
AlexWaygood 6ffb8c7
fix Windows?
AlexWaygood b8da0cf
Resolve `--venv-path` relative to `cli_base_path` in the CLI
AlexWaygood File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
1 change: 0 additions & 1 deletion
1
crates/red_knot_workspace/resources/test/unix-uv-venv/CACHEDIR.TAG
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
crates/red_knot_workspace/resources/test/unix-uv-venv/bin/python
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
crates/red_knot_workspace/resources/test/unix-uv-venv/bin/python3
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
crates/red_knot_workspace/resources/test/unix-uv-venv/bin/python3.12
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
...d_knot_workspace/resources/test/unix-uv-venv/lib/python3.12/site-packages/_virtualenv.pth
This file was deleted.
Oops, something went wrong.
103 changes: 0 additions & 103 deletions
103
...ed_knot_workspace/resources/test/unix-uv-venv/lib/python3.12/site-packages/_virtualenv.py
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
crates/red_knot_workspace/resources/test/unix-uv-venv/pyvenv.cfg
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels a bit surprising that
VirtualEnvironment
is part of thesite_packages
module. Shouldn' we rename thesite_packages
module tovenv
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That might make @carljm upset, since he keeps pointing out that several of the routines in this module really work with any Python installation, not just virtual environments 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm yeah. Not sure. The hierarchy just feels slightly off to me. But we can also revisit this later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it would depend how you do it :) I was actually going to make a similar comment and decided not to. But I would not want to just rename this module, I would want two modules, one which is specific to venvs and one which contains stuff that works on Python installations in general. But I'm also fine with just keeping it all in one module for now, which is why I didn't make that comment :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I'll leave this for now; we can come back to it later