Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors depend on the existence of .mypy_cache #10906

Closed
Vasniktel opened this issue Aug 1, 2021 · 2 comments
Closed

Errors depend on the existence of .mypy_cache #10906

Vasniktel opened this issue Aug 1, 2021 · 2 comments
Labels
bug mypy got something wrong

Comments

@Vasniktel
Copy link

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.

  1. docker run -it python:3.9-slim bash
  2. pip install spacy==3.1.1 mypy==0.910
  3. Create a test file to check:
import spacy

spacy.cli.download('en_core_web_sm')
  1. Add mypy configs:
[mypy]
python_version = 3.9
strict = True
show_error_codes = True
pretty = True
warn_unreachable = True

Expected 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
@Vasniktel Vasniktel added the bug mypy got something wrong label Aug 1, 2021
@Vasniktel Vasniktel changed the title Errors depend on the existing of .mypy_cache Errors depend on the existence of .mypy_cache Aug 1, 2021
@hauntsaninja
Copy link
Collaborator

Thanks, duplicate report, see #9852 (comment)

@hauntsaninja
Copy link
Collaborator

Fixed by #10937

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong
Projects
None yet
Development

No branches or pull requests

2 participants