Nested virtual environment support in site/venv modules
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 77.2k
- Forks
- 35.9k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
Feature or enhancement
Proposal:
It's a bit of a niche use case, but it would be helpful if you could have one virtual environment be created that references another as its parent. If you currently attempt to do this, the pyvenv.cfg of the child virtual environment only indirectly references the parent through the command variable (which doesn't appear to be used). The code in site.venv could be enhanced to infer the prefix of the parent environment and add those site packages after the current virtual environment. This would ensure that the order of sys.path entries would be appropriate.
This would allow you to create a group virtual environment with a lot of common packages and still allow users to have their own child environments with additional or newer packages.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne in Lib/site.py bei der in der Issue referenzierten Implementierung von site.venv und untersuche, wie pyvenv.cfg und die Variable command derzeit behandelt werden. Lege fest, wie eine untergeordnete Umgebung ihr übergeordnetes Präfix ableiten und die Site-Packages des übergeordneten Verzeichnisses nach den Einträgen der untergeordneten Umgebung anordnen soll; als abgeschlossen gilt die Aufgabe, wenn verschachtelte Umgebungen die vorgesehene Reihenfolge von sys.path aufweisen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- developer-experience
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 38/100