Detect if shell is in activated virtual environment, but mypy is not installed in it.
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 20.6k
- Fork
- 3.3k
- Metriche di merge delle PR
- Metriche PR in attesa
Descrizione
Feature
Detect if $VIRTUAL_ENV is defined when running mypy, potentially only if we report missing imports.
Pitch
Right now, if mypy is installed globally, and a user activates a virtual environment, they could be confused about missing import errors (e.g. https://github.com/python/mypy/issues/7237) where the packages are installed in the virtual environment but mypy can't see them. In such a scenario, we'd be able to detect that $VIRTUAL_ENV is set, and we could report a warning if that path doesn't match the prefix of sys.executable.
One question about this is should we report this in general or only if we report a missing import.
I think there probably are use cases where people don't care about running mypy globally, so my initial inclination would be to only report this and suggest --python-executable if an import is missing.
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
Inizia tracciando il modo in cui mypy segnala gli import mancanti e determina l’interprete in esecuzione a partire da sys.executable. Confronta quel prefisso con il valore di VIRTUAL_ENV e decidi se l’avviso debba essere limitato ai casi di import mancanti, quindi raccomanda --python-executable; il lavoro è concluso quando il comportamento e l’ambito sono coperti dai test.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- devtools
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 30/100