On Tue, 20 Oct 2020 at 20:16, Chris Angelico <ros...@gmail.com> wrote:
> What's the mechanism by which a venv announces its parent, and does > this work correctly if the binary is invoked directly? Currently, if > you invoke /.../.../.../env/bin/python3, it will use the lib directory > from that venv; with this plan, it would need to add the parent also. I'd imagine that the "parent" could be put in `pyvenv.cfg`, and the interpreter startup code would (somehow) add that to `sys.path`. Which is mostly straightforward, but `sys.path` setup is (I believe) fairly deeply entangled with interpreter startup. I'd assume that the effect of the mechanism would be just like any other means of adding entries to sys.path - that's both the intended layering benefits, and the potentially bad/confusing ones like different versions of a package shadowing each other. It's also worth noting that tools like pip would probably struggle with managing linked environments like this. I suspect that's actually a far bigger problem than the core mechanism. Pip is already struggling with the amount of complexity it has to deal with, I don't think we'd be able to add something like this. So you might have to manually manage the "layers", or build a tool that wraps pip and handles the layering. Paul _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/RK3NR7YW3XKY6U72WOVLSCY4IA5HS54V/ Code of Conduct: http://python.org/psf/codeofconduct/