You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Mypy errors after flake8-pyi Y037 changes: Type application has too many types (1 expected) #9690
According to changelog#9686 was the only change in that version.
Errors like this appear in every test:
requests-stubs/sessions.pyi:80: error: Type application has too many types (1 expected) (diff)
requests-stubs/sessions.pyi:81: error: Type application has too many types (1 expected) (diff)
requests-stubs/sessions.pyi:99: error: Type application has too many types (1 expected) (diff)
requests-stubs/sessions.pyi:106: error: Type application has too many types (1 expected) (diff)
urllib3-stubs/fields.pyi:6: error: Type application has too many types (1 expected) (diff)
Same question as #9686 (comment): do your tests run with mypy 1.0? If not, then you may need to upgrade to mypy 1.0 (or temporarily pin to a lower version of types-requests).
That error message comes from python/mypy#11098, but that bug should have been fixed in mypy 1.0.
We should probably document better that our stubs can generally only be guaranteed to be compatible with the latest version of $TYPECHECKER. We've previously discussed that in #6843.
But seriously, mypy 1.0 hasn't even been out for 24 HOURS yet! Is it really considered reasonable in this project to break users so quickly following a release?
But seriously, mypy 1.0 hasn't even been out for 24 HOURS yet! Is it really considered reasonable in this project to break users so quickly following a release?
That's useful feedback, thanks -- and I'm sorry for the disruption caused. I'll try to be more cautious when making changes to third-party stubs in the future.
For context: for me, this was about closing an issue that had been open for over two years, which I was excited to finally resolve. Moreover, being able to see whether we could finally close the issue felt like a useful way of testing the latest mypy release.
Unfortunately I doubt that there's much we can do here now that types-requests 2.28.11.11 has been released, so your best bet is probably to pin types-requests and types-urllib3 -- as you've already proposed in typeddjango/djangorestframework-stubs#345.
I'll try to do better in the future; apologies again.
Fair enough, hopefully this issue will be findable via Google soon and other users who stumble upon this get a quicker answer. Maybe keep it open for a while.
Activity
AlexWaygood commentedon Feb 7, 2023
Same question as #9686 (comment): do your tests run with mypy 1.0? If not, then you may need to upgrade to mypy 1.0 (or temporarily pin to a lower version of
types-requests).That error message comes from python/mypy#11098, but that bug should have been fixed in mypy 1.0.
AlexWaygood commentedon Feb 7, 2023
We should probably document better that our stubs can generally only be guaranteed to be compatible with the latest version of
$TYPECHECKER. We've previously discussed that in #6843.intgr commentedon Feb 7, 2023
What does it look like I'm doing 😆
No, there's a PR typeddjango/djangorestframework-stubs#339 that had issues due to changes in another upstream project. Whilst fixing those in typeddjango/djangorestframework-stubs#345 I ran into this issue.
But seriously, mypy 1.0 hasn't even been out for 24 HOURS yet! Is it really considered reasonable in this project to break users so quickly following a release?
AlexWaygood commentedon Feb 7, 2023
That's useful feedback, thanks -- and I'm sorry for the disruption caused. I'll try to be more cautious when making changes to third-party stubs in the future.
For context: for me, this was about closing an issue that had been open for over two years, which I was excited to finally resolve. Moreover, being able to see whether we could finally close the issue felt like a useful way of testing the latest mypy release.
AlexWaygood commentedon Feb 7, 2023
Unfortunately I doubt that there's much we can do here now that
types-requests2.28.11.11 has been released, so your best bet is probably to pintypes-requestsandtypes-urllib3-- as you've already proposed in typeddjango/djangorestframework-stubs#345.I'll try to do better in the future; apologies again.
intgr commentedon Feb 7, 2023
Fair enough, hopefully this issue will be findable via Google soon and other users who stumble upon this get a quicker answer. Maybe keep it open for a while.
AlexWaygood commentedon Feb 21, 2023
Mypy 1.0 has been out for two weeks now, so I'm going to close this now. Thanks again for reporting the issue, though.