Make pyvenv.cfg
-relocation part of the interpreter initialization instead of the site
module
#126985
Labels
type-feature
A feature request or enhancement
Feature or enhancement
Proposal:
Currently, the mechanism behind virtual environments is implemented in the
site
module. This means that disabling thesite
initialization (passing-S
) disables virtual environments.I would like to move the virtual environment detection from
site
to the interpreter initialization (getpath
), which would essentially consist of settingsys.prefix
tosys.exec_prefix
to the virtual environment prefix ingetpath
.The motivation is the same as GH-126793, the same UX example applies. Running
python -S -m ensurepip
inside a virtual environment would install to the system, instead of the virtual environment.Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs
The text was updated successfully, but these errors were encountered: