-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
State of the Mypy cache makes check results unpredictable #10221
Comments
Thanks for the detailed bug report! Mypy should produce the same results independent of the cache state. Any deviations are unexpected (unless the cache is corrupted, but any cache generated by mypy should be fine, including older versions). |
We see similar issues relating to the |
I think I've hit this one - also mypy 0.812. Now clearing the cache before all runs to avoid possible intermittent errors - bit inconvenient as the run time is much longer without a warm cache. |
I think I've seen this recently (matrix-org/synapse#13500, where we also use mypy-zope). I could reproduce the example using twisted 21.2.0, mypy 0.981 and mypy-zope 0.3.10. Once you get into the stuck state described, I noticed that I wonder if this might be a mypy-zope issue rather than a mypy issue? I'll chuck some print statements into mypy and see if I can find any clues. |
Cross-referencing: Shoobx/mypy-zope#76 |
Shoobx/mypy-zope#80 fixes the problems I was seeing here. If you're also seeing this and are using mypy-zope, it might be worth trying the latest release. |
Nice work! |
For cross-referencing: this might be covered by #10360? |
The result of mypy checking a piece of code depends on both that code and the internal mypy cache. The same piece of code can cause mypy to produce two different results depending on the state of the mypy cache.
(A clear and concise description of what the bug is.)
To Reproduce
Run mypy 3 times. The first run is against version "A" of the demonstration code. The second run is against version "B" of the demonstration code and introduces some mypy errors. The third run is against version "A" of the demonstration code - again. But this time it comes with the same errors version "B" received.
Expected Behavior
The two runs of mypy against version "A" of the code should produce the same result.
Actual Behavior
The two runs of mypy against version "A" of the code produce different results.
Your Environment
mypy.ini
(and other config files):Also required by the demo program above, Twisted 21.2.0.
The text was updated successfully, but these errors were encountered: