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

Caching errors with latest version of mypy #76

Closed
euresti opened this issue Aug 26, 2022 · 1 comment · Fixed by #80
Closed

Caching errors with latest version of mypy #76

euresti opened this issue Aug 26, 2022 · 1 comment · Fixed by #80

Comments

@euresti
Copy link
Contributor

euresti commented Aug 26, 2022

Hi. With the latest version of mypy and mypy-zope we're getting mypy errors that I think are cache related. The error goes away after rm -rf .mypy_cache

Here's the smallest repro I could make:

src/zg/foo.py:

from zg.bar import ZGScriptProtocol

print(ZGScriptProtocol.transport)

src/zg/bar.py:

from twisted.internet.protocol import ProcessProtocol

class ZGScriptProtocol(ProcessProtocol):
    pass

I am able to reliably hit the problem by running the following commands:

$ rm -rf .mypy_cache
$ mypy src/zg/foo.py 
Success: no issues found in 1 source file
$ mypy src/zg/foo.py src/zg/bar.py 
src/zg/bar.py:3: error: Cannot determine consistent method resolution order (MRO) for "ZGScriptProtocol"
src/zg/foo.py:3: error: "Type[ZGScriptProtocol]" has no attribute "transport"
$ mypy --version
mypy 0.971 (compiled: yes)

mypy-zope==0.3.9 and twisted[tls]==22.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants