mypy: Enable pydantic plugin#3012
Conversation
7868648 to
51ad136
Compare
|
What is the functional expectation as a result of this change? |
|
@nathan-weinberg sorry should have included the URL to plugin docs in PR description (it was in commit message only). Here it is: https://docs.pydantic.dev/latest/integrations/mypy/ tl;dr it may help mypy not fail on some tricky pydantic code. One example of this would be #2977 (comment) (point 2) except because there's a bug in pydantic itself and the fix for it is not, yet, released, we have to It also adds some additional typing checks too, so fewer gaps in coverage. On second thought, there are probably more options to tighten checks with the plugin, so I'll explore these first and include in this PR. I will move this to draft for now. |
This may help us avoid some spurious mypy warnings when it gets confused by pydantic magick. It may also catch some additional typing violations in pydantic model definitions that are not recognized by stock mypy. See details about the plugin and what it provides at: https://docs.pydantic.dev/latest/integrations/mypy/ Note: this change also enables all strict checks for the plugin. Fortunately, the code tree didn't have anything to adjust to adopt these. Signed-off-by: Ihar Hrachyshka <[email protected]>
51ad136 to
f1df1ad
Compare
|
This pull request has been automatically marked as stale because it has not had activity within 60 days. It will be automatically closed if no further activity occurs within 30 days. |
|
On one hand, it's really a low importance change. On the other hand, I am surprised we can't find a second reviewer to just let it in. :) |
This may help us avoid some spurious mypy warnings when it gets confused by pydantic magick.
https://docs.pydantic.dev/latest/integrations/mypy/
Noticed when looking at mypy violations under #2977
Checklist:
conventional commits.