-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
Replace pyvenv.cfg
's home
key with base-prefix
and base-exec-prefix
#127895
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
Comments
Optionally, we can also maybe add |
I also independently advocated for this yesterday in #106045 (comment). I then realised that these heuristics are also being used for non-venv based prefix determination, and now appreciate that when running a plain CPython interpreter, all you have is the executable path (plus a sysconfig full of paths for where Python was built) and heuristics are seemingly still necessary. If we could remove the need for the core interpreter heuristics (e.g. by only using the build config), then I think we should also remove the heuristics from venv exec/prefix determination. On the other hand, if we don't manage to remove the heuristics at the core, then I would advocate for removing All of this sounds like it needs a change to PEP-405 though? |
FWIW, I believe I agree with this, based on my experience computing |
I wonder if it wouldn't be required for venv launchers anyway (if not required, it would certainly simplify various paths computations in those launchers). |
Feature or enhancement
Proposal:
The
home
key inpyvenv.cfg
is used to specify the directory where the base Python executable is. During the Path Initialization, this directory, and consecutively its parents, is searched for stdlib landmarks to determinesys.base_prefix
andsys.base_exec_prefix
. Naturally, this isn't ideal, it would be better ifpyvenv.cfg
contained these values directly.Proposed plan:
venv
to start setting thebase-prefix
andbase-exec-prefix
keys inpyvenv.cfg
when creating/updating environmentsgetpath
, use thebase-prefix
andbase-exec-prefix
keys to set the prefixeshome
, inpyvenv.cfg
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
The text was updated successfully, but these errors were encountered: