I’ve drafted two PEPs that extract ideas I found in PEP 582, but modified to apply to virtual environments. Links to rendered version below.
This one proposes a directory similar to
__pypackages__ as a standard locations to store virtual environments in a project root. Directories in it should be named like
cpython-3.8-macosx_10.15_x86_64 so tools can reliably locate environments created by another tool.
This is a writeup of my own idea on the interpreter-independent virtual environment. This adds a
PYTHONVENV environment variable to interpreter startup, so a site-packages prefix can be used without having a
python command inside it. This can be used to loosen virtual environment requirements, and allow more flexible workflows like:
python -m pip install --prefix ./env PYTHONVENV=$PWD/env python # Use packages installed in the prefix.
Tools wrapping the virtual environment (e.g. tox, pipenv) workflow can also use this to more easily set up a script to run inside an environment.
I need sponsors to submit them to the PEPs respository as drafts. Each of them will get its own post under the PEPs category when they are merged, but feel free to discuss anything down here before that happens as well.