Closed
Description
Bug Report
mypy
reliably fails to take into account a type: ignore
comment on the second run after deleting the cache.
To Reproduce
rm -r .mypy_cache
mypy .
mypy .
Expected Behavior
The second run of mypy
should behave exactly the same as the first run.
Actual Behavior
$ rm -r .mypy_cache
$ mypy .
Success: no issues found in 23 source files
$ mypy .
infra/app.py:9: error: Skipping analyzing 'aws_cdk': found module but no type hints or library stubs
infra/datalake/datalake_stack.py:4: error: Skipping analyzing 'aws_cdk': found module but no type hints or library stubs
infra/datalake/datalake_stack.py:4: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
Found 2 errors in 2 files (checked 23 source files)
Some subsequent runs will succeed, but I've not looked into the pattern. I was able to run while pre-commit run --all-files mypy; do rm -r .mypy_cache; done
a bunch of rounds without failure.
Your Environment
- Mypy version used: 0.790
- Mypy command-line flags: None
- Mypy configuration options from
mypy.ini
(and other config files): None - Python version used: 3.8.6
- Operating system and version: Arch Linux
Workaround
Add --no-incremental
to the mypy
arguments.