Custom environments in subinterpreters
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 77.2k
- Fork
- 35.9k
- Metriche di merge delle PR
- Metriche PR in attesa
Descrizione
Feature or enhancement
Proposal:
I wanted to explore the viability of having custom environments in subinterpreters. There are several use-cases that could be enabled by this feature.
So far, from informal discussion with others about this, there are a couple possible issues to take into consideration.
Issues
- Some of the immortal objects shared between subinterpreter may be environment-dependent (pointed out by @Yhg1s)
- Complications around dynamic loading, by having extension modules from different environments
2.1) Symbol conflicts from their dependencies (pointed out by @Yhg1s)
2.2) Since subinterpreters share the same process, when loading the same shared object, they get the same pointer (pointed out by @pablogsal)
Implementation
The main thing we need is a way to disable the site initialization, which could be a enable_site option in the interpreter config. This should disable the environment customizations, and result in a bare environment without anything extra sys.path.
However, to make the use of different environments more ergonomic, we could add an environment_path location pointing to a directory containing a pyvenv.cfg, which would perform the site initialization for that environment.
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
La issue non indica file né test; inizia esaminando la configurazione dell’interprete di subinterpreter e l’inizializzazione di site. Valuta le opzioni proposte enable_site e environment_path rispetto alle problematiche elencate relative a immortal-object e dynamic-loading. Il lavoro sarà considerato completato quando sarà definito un design concordato che risolva tali problematiche e stabilisca l’ambito dell’implementazione.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- backend
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100