That’s not a specific concern if we make this generic.
Are you shipping build-details.json with Python? And if so, I assume you can still figure out how to find the file based on the location of the Python binary?
Reading Configuration — conda-workspaces and the blog post makes it seem like there’s less of a concern for conda thanks to the [environments] table in conda.toml / pixi.toml. Having that plus knowing where the environments are stored would tell a tool where to find the Python binary to use if the tool knew how to interpret all of that appropriately, correct? Is all of that knowable without running conda explicitly?
Supporting environments stored outside of the project’s directory is a key feature of the PEP (i.e. the concept of a redirect file), so I disagree
(was something not clear in the PEP about this, or have you not read it yet?).
Don’t worry, that’s not even a possibility for this PEP thanks to the stdlib lacking a YAML parser. ![]()
Having a configuration makes this more user-visible than this PEP meant for it to be, as it’s focused on tool-to-tool. That’s why the .venv redirect file is a dot file: I don’t expect most users to directly care about the file.
The PEP is about where an environment is, not what’s in an environment. As such, putting anything in pyproject.toml would mean tools are now dictating to all contributors where a virtual environment is kept while I’m considering that a user/tool choice (e.g. I keep my virtual environments in my project while others don’t).
To do what I think you’re suggesting would take not just an [environments] table in pyproject.toml to record what goes into an environment (which might not be as big of a need thanks to dependency groups), but also agreeing on how to find the various environments. So that would mean all workflow tools agreeing on where to keep virtual environments as well as how to programmatically know where to find them without running the workflow tool itself. That’s a bigger ask and would require people like @frostming , @cjames23 , @bernatgabor , and @zanie to agree on wanting that level of coordination/standardization for their respective tools. The PEP as written is designed to keep it simple and flexible to answer the question, “where can I find the default/preferred virtual environment for this project?” I think what you’re asking for pushes this out to encompass multiple virtual environments as well as dictating the directory location and name to know what and who a virtual environment is for (otherwise we’re back to where this PEP is). And considering projects like virtualenv explicitly support environment sharing across projects, it’s probably a no-go.
As such, the best I can think of is this PEP takes what’s (mostly) in Provide structured output for environment/interpreter discovery · brettcannon/python-launcher · Discussion #168 · GitHub and write that to a file as a way to record where to find things.