with -p or -m, error if the package name is not importable
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
When the command line is issued specifying scan targets using -p or -m, verify that a package is importable under that name and fail if not.
Pitch
I was scanning two related packages using:
mypy --namespace_packages -p namesp.pkg1 -p namesp_pkg2
The second was a typo, the folder name for the (namespace) package that was a child of $PWD. I got error messages, but they were very confusing, about a file being found in two locations (where the "same" command line, as I thought, had worked properly just two days before). I didn't figure out it was a typo for quite some time.
But obviously, there is no package namesp_pkg2 and an error to that effect would have saved me some time.
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 dalla gestione della riga di comando di mypy per le opzioni -p e -m e riproduci l'esempio con un nome di pacchetto scritto deliberatamente in modo errato. Segui il punto in cui vengono convalidati i target di scansione, quindi conferma che un pacchetto non importabile produca un errore diretto invece di messaggi diagnostici fuorvianti su file duplicati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- cli
- Tipo di issue
- Funzionalità
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100