exclude should imply a per-module follow import skip for matching modules
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 20.6k
- Forks
- 3.3k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
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
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
Reproduziere den Bericht mit mypy 0.812 unter Verwendung von mypy src und den in setup.cfg oder mypy.ini gezeigten exclude-Einstellungen, mit Fokus auf src/tinuous/_version.py. Verfolge, wie --exclude und importierte Module behandelt werden, und überprüfe anschließend, dass passende Module ohne Fehler übersprungen werden, während andere Module in src weiterhin geprüft werden.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100