[cherry-pick] Fix mypy plugin for 1.1.0 (#5077)#5111
[cherry-pick] Fix mypy plugin for 1.1.0 (#5077)#5111dmontagu merged 5 commits intopydantic:1.10.X-fixesfrom cdce8p:backport-plugin-fix
Conversation
* Fix mypy plugin for 1.1.0 * Code review * Add version key to plugin data (cherry picked from commit 6267ae3)
|
I couldn't test this with V2 because mypy just ran forever, but I think this is still broken on this branch (at least with [tool.poetry]
name = "test-project"
version = "1"
description = ""
authors = []
[tool.poetry.dependencies]
python = "~3.11"
mypy = { git = "https://github.com/python/mypy.git", rev = "release-1.1" }
pydantic = { git = "https://github.com/cdce8p/pydantic", rev = "backport-plugin-fix"}
[tool.mypy]
plugins = ["pydantic.mypy"]import pydantic
@pydantic.dataclasses.dataclass
class A:
a: str
A("") # error: Too many positional arguments for "A" [misc] |
See #5077 (comment) |
|
@samuelcolvin This PR is ready. I guess the |
|
we'll need to rename the change file so the link is right in the changelog, I'll do that when I get time. |
I can do it, no problem. However, as it isn't renamed by the backport bot, I though it would be good here. It's basically the same PR as #5110, just without the merge conflict. |
|
I guess we could either extend the backport bot to rename the change file, or change hooky to recognise the change file, but for now it, I think it's easiest just to rename it manually. |
|
I have run the mypy tests with mypy==1.1.1; here is a breakdown of the failures:
I consider all of the above new kinds of errors to be acceptable, especially considering that, with the exception of @samuelcolvin the only thing I'm not sure of is if there are any concerns with adding the If the above is acceptable, I think we can merge this and cut a new 1.10.X release. |
|
Oh actually, @cdce8p could you check and confirm that, with this branch, there isn't anything else that could/should be fixed that I haven't already discussed in my previous comment? |
AFAICT those are the same observations I saw during testing. So it should be good.
Some background, this was still an open question in #5120. However, I noticed that other files already import |
|
Okay, in the interest of keeping things simple how about I just change it back to the imports being the same. I think in that case it will be non-controversial. |
|
Okay actually I take it back, I see we are actually using it in a more meaningful way than I expected. Considering how fast |
|
@dmontagu Thanks for the quick release! Just confirmed with Home Assistant, everything is working as expected (when using the plugin). |
(cherry picked from commit 6267ae3)
Manual backport to avoid and resolve merge conflict. Alternative to #5110.