-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
bugmypy got something wrongmypy got something wrong
Description
Bug Report
Depending on the existence of the cache, mypy can produce different errors.
To Reproduce
This issue can be reproduced using the spacy library.
docker run -it python:3.9-slim bashpip install spacy==3.1.1 mypy==0.910- Create a test file to check:
import spacy
spacy.cli.download('en_core_web_sm')- Add
mypyconfigs:
[mypy]
python_version = 3.9
strict = True
show_error_codes = True
pretty = True
warn_unreachable = TrueExpected Behavior
One would expect that mypy errors should not depend on the cache existence.
Actual Behavior
Run mypy .. This will produce the following report the first time:
test.py:3: error: Module not callable [operator]
spacy.cli.download('en_core_web_sm')
^
Found 1 error in 1 file (checked 1 source file)
The second time (when .mypy_cache exists) you'll get:
test.py:3: error: Module has no attribute "cli" [attr-defined]
spacy.cli.download('en_core_web_sm')
^
Found 1 error in 1 file (checked 1 source file)
Your Environment
- Mypy version used: 0.910
- Python version used: 3.9.6
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrong