- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add support for removing TypeVarDef in mypy 0.920 #3175
Add support for removing TypeVarDef in mypy 0.920 #3175
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great thanks! 👍
10f4dc0
to
2b1818b
Compare
Looks like maybe this is failing tests? :/ I think the behavior of |
Oh didn't see it was not in official release. I went too fast. |
Just pushed a commit that's passing pydantic/mypy.py:354: error: Too many arguments for "TypeVarType" [call-arg]
pydantic/mypy.py:354: error: Argument 1 to "TypeVarType" has incompatible type "str"; expected "TypeVarDef" [arg-type]
pydantic/mypy.py:654: error: List item 0 has incompatible type "TypeVarType"; expected "TypeVarLikeDef" [list-item] When the new version of Mypy comes out will we need to make a major version bump for this breaking change? I'm worried that this new usage of |
I believe all plugins have access to mypy version, which you could use to gate logic on. You could also e.g. do the equivalent of:
Also, in case it's useful, this is the issue where mypy announces breaking changes to plugins: python/mypy#6617 (comment) |
Now that mypy 0.920 has been released, I'm seeing this issue with pydantic 1.8.2:
|
0.920 has been released, but pydantic.mypy plugin is not compatible cap mypy until pydantic get updated. pydantic/pydantic#3175 Change-Id: Idd714099c176a26db873ed4cfc0187f443ddfb2e
0.920 has been released, but pydantic.mypy plugin is not compatible cap mypy until pydantic get updated. pydantic/pydantic#3175 Change-Id: Idd714099c176a26db873ed4cfc0187f443ddfb2e
pydantic/pydantic#3528 python/mypy#6617 (comment) pydantic/pydantic#3175 (comment) updating mypy in build yml and requirements to 0.910
180a9a7
to
7ca3972
Compare
This comment has been minimized.
This comment has been minimized.
Just pushed another commit so that this works correctly in both 0.910 and 0.920 -- please let me know if there's anything else. |
pydantic/pydantic#3528 python/mypy#6617 (comment) pydantic/pydantic#3175 (comment) updating mypy in build yml and requirements to 0.910 Co-authored-by: stas <statis@microsoft.com>
Includes workarounds for tmbo/questionary#191 and pydantic/pydantic#3175.
Hey @samuelcolvin, do you have an estimate on when the next release of pydantic would be that would include this change? Thanks! |
@hughhan1 pre-release candidate |
Includes workarounds for tmbo/questionary#191 and pydantic/pydantic#3175.
Includes workarounds for tmbo/questionary#191 and pydantic/pydantic#3175.
Includes workarounds for tmbo/questionary#191 and pydantic/pydantic#3175.
Includes workarounds for tmbo/questionary#191 and pydantic/pydantic#3175.
Includes workarounds for tmbo/questionary#191 and pydantic/pydantic#3175.
pydantic/pydantic#3528 python/mypy#6617 (comment) pydantic/pydantic#3175 (comment) updating mypy in build yml and requirements to 0.910 Co-authored-by: stas <statis@microsoft.com>
Change Summary
Problem: While using the Pydantic plugin with Mypy 0.920 there is an error about
TypeVarDef
not being defined.Solution: Add support for Mypy 0.920 without breaking compat with Mypy 0.910.
See-also: python/mypy#9951
Related issue number
Fixes #3528
Checklist
changes/<pull request or issue id>-<github username>.md
file added describing change(see changes/README.md for details)