exclude should imply a per-module follow import skip for matching modules
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the report with mypy 0.812 using mypy src and the exclude settings shown in setup.cfg or mypy.ini, focusing on src/tinuous/_version.py. Trace how --exclude and imported modules are handled, then verify that matching modules are skipped without errors while other modules in src are still checked.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100