exclude should imply a per-module follow import skip for matching modules
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
Bug Report
I recently converted this project (linked to at the most recent commit) from a plain script to a Python package. This included adding an un-annotated _version.py file generated by versioneer to the package. mypy (when run as mypy src) now reports errors due to _version.py lacking any type annotations, and I cannot get it to ignore that file.
What I've tried:
- Adding
exclude = _version.pyto the[mypy]section insetup.cfg - Adding
exclude = src/tinuous/_version.pyto the[mypy]section - Adding
exclude = src/tinuous/_(version|_init__).pyto the[mypy]section - Running just
mypy src/tinuous/__main__.py - Running
mypy --exclude _version.py src
In all of these cases, mypy spits out errors relating to _version.py even though I thought I told it to ignore that file.
Your Environment
- Mypy version used: 0.812
- Mypy command-line flags:
--excludeor nothing - Mypy configuration options from
mypy.ini(and other config files):
[mypy]
ignore_missing_imports = True
disallow_untyped_defs = True
disallow_incomplete_defs = True
no_implicit_optional = True
warn_redundant_casts = True
warn_return_any = True
warn_unreachable = True
local_partial_types = True
no_implicit_reexport = True
strict_equality = True
show_error_codes = True
show_traceback = True
pretty = True
plugins = pydantic.mypy
# Various "exclude" options (see above)
- Python version used: 3.9.4
- Operating system and version: macOS 11.2.1
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
Riproduci il report con mypy 0.812 usando mypy src e le impostazioni exclude mostrate in setup.cfg o mypy.ini, concentrandoti su src/tinuous/_version.py. Traccia la gestione di --exclude e dei moduli importati, quindi verifica che i moduli corrispondenti vengano ignorati senza errori mentre gli altri moduli in src continuino a essere controllati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- tooling
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100