Skip to content
Open
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
ceeaa3b
initial file
rickeylev Jun 27, 2025
d0a9289
add some core content
rickeylev Jun 28, 2025
41d2ea8
rename to motivation
rickeylev Jun 28, 2025
65a415c
note it enables more advanced optimizations
rickeylev Jun 28, 2025
4175b20
add foot notes, relocatable term section, links
rickeylev Jun 29, 2025
bbc85b7
update discussion, sponsor headers to pending
rickeylev Jun 29, 2025
a0c2529
rst fixups
rickeylev Jun 29, 2025
8e6e21e
fixup italics
rickeylev Jun 29, 2025
37202ca
rename to relative-venv
rickeylev Jun 29, 2025
b81c50f
clarify advanced deployment options, reflow some text
rickeylev Jun 30, 2025
55a5e28
add specification, rationale section; doc why env vars arent an option
rickeylev Jun 30, 2025
e09b00d
also mention curdir syntax handling
rickeylev Jun 30, 2025
c7a6a9b
update some todo text
rickeylev Jun 30, 2025
bc1ffbd
update codeowners
rickeylev Jun 30, 2025
2301d2a
add initial discussion footnote link
rickeylev Jun 30, 2025
e14b01f
add fr footnote
rickeylev Jun 30, 2025
175f378
revert codeowners change
rickeylev Jun 30, 2025
31cb756
remove packaging-related specs
rickeylev Jul 2, 2025
cd46f4d
fix lint errors with headers
rickeylev Jul 2, 2025
b532f5c
set sponsor
rickeylev Jul 2, 2025
99434fc
set sponsor as codeowner
rickeylev Jul 2, 2025
862142a
clarify title to focus on core pyvenv.cfg home behavior
rickeylev Jul 2, 2025
1c8fb2d
fix typo; remove host-relocatable mention; remove non-germane copying…
rickeylev Jul 2, 2025
c542890
fix typos, grammar
rickeylev Jul 2, 2025
3240227
Apply suggestions from code review
rickeylev Jul 2, 2025
557cb71
fix up markdown and text width
rickeylev Jul 2, 2025
0579623
fix title underlines
rickeylev Jul 2, 2025
c9388b3
link to relative venv reference implementation
rickeylev Jul 2, 2025
b959f24
Apply suggestions from code review
rickeylev Jul 6, 2025
5b259cc
Apply suggestions from code review
rickeylev Aug 17, 2025
560dadb
Merge branch 'main' of https://github.com/python/peps into relative.v…
rickeylev Aug 17, 2025
f41ed51
Merge branch 'relative.venvs' of https://github.com/rickeylev/peps in…
rickeylev Aug 17, 2025
5cbc9f5
better answer why/how relvenvs help; wrap some long lines
rickeylev Aug 17, 2025
0af0eea
Apply AA-Turner suggestions
rickeylev Aug 21, 2025
68dd5e0
add refs, remove CWD acronym, fix grammar
rickeylev Aug 21, 2025
b50a80c
address review comments: better split and organize rationale/motivation
rickeylev Aug 24, 2025
af8f880
Merge branch 'main' into relative.venvs
AA-Turner Sep 29, 2025
ae5a67f
Apply markup and simple grammar fixes from code review
ncoghlan Oct 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
better answer why/how relvenvs help; wrap some long lines
  • Loading branch information
rickeylev committed Aug 17, 2025
commit 5cbc9f57b7d7717d7530d8363587b3af3aeed164
30 changes: 18 additions & 12 deletions peps/pep-0796.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,20 @@ requirement should be relaxed and relative path behavior allowed and defined.

Second, such relative paths are a building block to enable portable virtual
environments, i.e. copying a virtual environment as-is between hosts of
compatible platforms. Portable virtual environments are appealing because virtual environments
are a popular mechanism for running Python applications. This provides several
compatible platforms. For example, by pointing to a parent directory, the
virtual environment becomes independent of path prefix differences between
hosts (e.g. ``/usr/local/`` in a container vs
``/home/user/.pyenv/versions/3.12.0/bin`` in a user's dev environment).

Portable virtual environments are appealing because virtual environments are a
popular mechanism for running Python applications. This provides several
benefits:

* The closer the development environment is to the non-development environment,
the more reliable software can be achieved, and the easier it is to reproduce
issues
* The simpler the process of re-creating the environment, the more reliable
software can be achieved, and the faster the process can be.
environment-specific issues are less likely, and the easier it is to
reproduce issues.
* The simpler the process of re-creating the environment, environment-specific
issues are less likely, and the faster the process can be.

Making it simpler to copy a virtual environment from one host to another
mitigates these categories of problems. Additionally, the development tools to
Expand Down Expand Up @@ -157,10 +162,10 @@ accordingly.
How to Teach This
=================

Teaching this should be straightforward: if you use a relative path in ``pyvenv.cfg``,
then it's relative to the directory containing the ``pyvenv.cfg`` file. This
is simple to explain and easy to understand for anyone that is already familiar
with handling relative filesystem paths.
Teaching this should be straightforward: if you use a relative path in
``pyvenv.cfg``, then it's relative to the directory containing the
``pyvenv.cfg`` file. This is simple to explain and easy to understand for
anyone that is already familiar with handling relative filesystem paths.


Reference Implementation
Expand Down Expand Up @@ -189,8 +194,9 @@ References
* `rules_py <https://github.com/aspect-build/rules_py>`__: implements
host-relocatable virtual environments.
* `python-build-standalone <https://github.com/astral-sh/python-build-standalone>`__
* `venvstacks <https://pypi.org/project/venvstacks/>`__: a tool for creating reproducible distribution artifacts from virtual environments
A relocatable Python runtime.
* `venvstacks <https://pypi.org/project/venvstacks/>`__: a tool for creating
reproducible distribution artifacts from virtual environments A relocatable
Python runtime.
* `PoC for relative home in Python startup <https://github.com/python/cpython/compare/main...rickeylev:cpython:feat.relative.pyvenv.home>`__
* `Python Ideas "Making venvs relocatable friendly" discussion <https://discuss.python.org/t/making-venvs-relocatable-friendly/96177>`__
* `gh-136051: relative pyvenv.cfg home <https://github.com/python/cpython/issues/136051>`__
Expand Down