Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork1.7k
PEP 796: Relative Virtual Environments#4476
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Changes from1 commit
ceeaa3bd0a928941d2ea865a415c4175b20bbc85b7a0c25298e6e21e37202cab81c50f55a5e28e09b00dc7a6a9bbc1ffbd2301d2ae14b01f175f37831cb756cd46f4db532f5c99434fc862142a1c8fb2dc5428903240227557cb710579623c9388b3b959f245b259cc560dadbf41ed515cbc9f50af0eea68dd5e0b50a80caf8f880ae5a67fFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -17,7 +17,7 @@ in a Python virtual environment's :file:`pyvenv.cfg` file. | ||
| Specifically, we will discuss how such relative paths are understood | ||
| by the Python startup process, including their conversion to absolute | ||
| paths for use by the runtime. | ||
| This is a fundamental building block for virtual environments to | ||
| become more portable. | ||
| @@ -27,7 +27,7 @@ Motivation | ||
| There are two main motivations for allowing relative paths in ``pyvenv.cfg``. | ||
ncoghlan marked this conversation as resolved. OutdatedShow resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| First, it is currently prescribed that the ``home`` value in ``pyvenv.cfg`` be | ||
| an absolute path (`gh-135773`). The behavior of relative paths is unspecified. While | ||
| techniques exist to work around this for every other sub-part of a virtual | ||
| environment, the one remaining part without a tenable solution is how the | ||
| Python runtime itself finds ``PYTHONHOME``. This is because, currently, the | ||
| @@ -83,7 +83,7 @@ Tools that currently look to enable virtual environment portability across | ||
| machines do so either by relying on undocumented interpreter behaviour | ||
| (Bazel, omitting the ``home`` key entirely to trigger an implementation | ||
| dependent fallback to resolving via a symlinked interpreter binary on | ||
| non-Windows systems, see `gh-135773`) or by requiring a post-installation script to be executed | ||
ncoghlan marked this conversation as resolved. OutdatedShow resolvedHide resolvedUh oh!There was an error while loading.Please reload this page.
| ||
| after the environment is placed in its target location (venvstacks). | ||
rickeylev marked this conversation as resolved. OutdatedShow resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| Specification | ||
| @@ -122,8 +122,8 @@ primitives are there, so the only change needed is to define how it resolves | ||
| relative paths for ``home`` in ``pyvenv.cfg``. | ||
| Currently, relative paths resolve relative to the process's current working | ||
| directory. Becausethe current working directoryisn't knowable in advance, it | ||
| makes relative paths todayeffectively impossible. | ||
ncoghlan marked this conversation as resolved. OutdatedShow resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| Instead, the paths should be relative to the location of the ``pyvenv.cfg`` | ||
| file. This file is chosen as the anchor point because the tool that creates the | ||
Uh oh!
There was an error while loading.Please reload this page.