Skip to content

mypy is failing on the stdlib #7019

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

Closed
AlexWaygood opened this issue Jan 24, 2022 · 7 comments · Fixed by #7022 or #7548
Closed

mypy is failing on the stdlib #7019

AlexWaygood opened this issue Jan 24, 2022 · 7 comments · Fixed by #7022 or #7548

Comments

@AlexWaygood
Copy link
Member

CI is currently failing on all PRs with the following message from mypy:

stdlib/email/message.pyi:13: error: Cannot determine type of "Any" [has-type].

E.g.:

mypy appears to be failing on all platforms, but only on Python 3.8+.

I can also reproduce this error locally. No idea what's changed to make it suddenly start erroring as part of the CI checks, though.

@AlexWaygood
Copy link
Member Author

This is the line on which mypy is reporting the error:

_HeaderType = Any

But I have no idea why, as aliasing Any should be fine.

@hauntsaninja
Copy link
Collaborator

hauntsaninja commented Jan 24, 2022

Weird, from diffing CI runs, change of Python version from 3.10.1 to 3.10.2, maybe?

@AlexWaygood
Copy link
Member Author

Change of Python version from 3.10.1 to 3.10.2, maybe?

But it's also failing on 3.8!

@hauntsaninja
Copy link
Collaborator

hauntsaninja commented Jan 24, 2022

That's just the version that's being passed to mypy. In all cases, mypy is running on Python 3.10. I'm guessing there could be an ast regression, which is why we wouldn't see it in 3.7 and below (where mypy does not use ast)

@AlexWaygood
Copy link
Member Author

That's just the version that's being passed to mypy. In all cases, mypy is running on Python 3.10. I'm guessing there's an ast regression, which is why we don't see it in 3.7 and below (where mypy does not use ast)

Ah, gotcha.

@hauntsaninja
Copy link
Collaborator

Hmm, I can repro locally on 3.9.9 so that's probably not it.

Bad:
Screen Shot 2022-01-24 at 02 00 58

Good:
Screen Shot 2022-01-24 at 02 01 05

@hauntsaninja
Copy link
Collaborator

So weird. Thanks both for getting things green. I'd also welcome any hypotheses :-)

AlexWaygood added a commit that referenced this issue Mar 24, 2022
Let's see if this is fixed in mypy 0.942.

This reverts the changes made in #7022, which was a hack to fix #7019
JelleZijlstra pushed a commit that referenced this issue Mar 24, 2022
Let's see if this is fixed in mypy 0.942.

This reverts the changes made in #7022, which was a hack to fix #7019
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