-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
bpo-41011: venv -- add more variables to pyvenv.cfg (GH-30382) 8000 #30382
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
Merged
vsajip
merged 17 commits into
python:main
from
akulakov:41011-Add-more-vars-to-pyvenv.cfg
Jan 7, 2022
Merged
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
9857b28
added env_exec_cmd and env_create_command; added them to the test
akulakov 34f7943
add news entry
akulakov 0c7643c
update var names
akulakov e4bb85e
unskip a few tests
akulakov f93cae0
use sys.executable not sys.argv
akulakov fabe6eb
update news
akulakov 74bbfeb
update executable to be sys.executable and command to include args ba…
akulakov abef4f4
unskip tests
akulakov 1184ffb
fix test_defaults
akulakov 19d825e
fix test_defaults again
akulakov ac22946
update news
akulakov c891cac
update to generate --symlinks and --copies based on the OS; add promp…
akulakov 5afeb8a
add prompt to test
akulakov 727c515
quotes for orig_prompt
akulakov 0d44a7d
fix basic test for NT
akulakov 9f06b55
fix test config file for NT + copies flag
akulakov 0e519ec
mock setup pip for speed
akulakov 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
unskip tests
- Loading branch information
commit abef4f4a112267b74b4e51ed7118f63e3d68f631
There are no files selected for viewing
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
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
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.
(I appreciate that this PR is long since merged, but just following-up on a surprising
pyvenv.cfg
file that I saw recently, and git-blamed it back to here)I'm not at all sure why
realpath
is important here - thesys.executable
should be good enough when being called directly. When called through theEnvBuilder
, I don't see a reason for this either. 🤔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.
You're right, it is a difference when you're not on Windows. But thinking about it, you could view the config as recording the actual interpreter used instead of the path that could change on you in the future (e.g., some symlink later gets changed to point to another interpreter).
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.
Thanks for this perspective (I hadn't considered it)! I'm not sure that using a config file to log information about how a venv was created is a good idea, but can appreciate the idea. Since this is a machine readable file, I would be concerned that it eventually gets used for non-log/audit purposes.
I've been digging into symlink issues with venv a lot recently, and think calling
realpath
is quite problematic in other context (i.e. when determininghome
). More details of that in #106045.No follow-up needed here - just flagging it, and depending on the outcome of the linked issue, perhaps in the future I may request that this information become non realpath, or under a "history of how this venv was created" section of the config (perhaps in the form of a 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.
See also https://discuss.python.org/t/virtual-environments-vs-nix-python-upgrades/12588