ignore_missing_imports removed from mypy.ini not noticed due to cache.
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
- Are you reporting a bug, or opening a feature request?
bug
- Please insert below the code you are checking with mypy,
or a mock-up repro if the source is private. We would appreciate
if you try to simplify your case to a minimal repro.
$ cat >test.py <<__EOF__
import foobarxyz
__EOF__
$ cat >mypy.ini <<__EOF__
[mypy]
[mypy-foobarxyz]
ignore_missing_imports = True
__EOF__
$ mypy test.py
--> passes typecheck - GOOD
$ cat >mypy.ini <<__EOF__
[mypy]
__EOF__
$ mypy test.py
--> passes typecheck - BAD (*)
$ rm -R .mypy_cache
$ mypy test.py
--> fails typecheck - GOOD
-
What is the actual behavior/output?
In (*), the file passes typecheck even if we removedignore_missing_importsfrom config, which should result in an unresolved import. -
What is the behavior/output you expect?
A failed typecheck - the result with cache should be the same as without. -
What are the versions of mypy and Python you are using?
0.770
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 behavior with the issue's test.py and mypy.ini commands, then compare the cached run with the run after removing .mypy_cache. Trace how configuration changes affect the cache, and verify that removing ignore_missing_imports produces the same unresolved-import result with and without an existing cache.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100