Skip to content
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

Fix mypy v1 plugin for upcoming mypy release #9586

Merged
merged 1 commit into from
Jun 6, 2024

Conversation

cdce8p
Copy link
Contributor

@cdce8p cdce8p commented Jun 6, 2024

Change Summary

In python/mypy#17311 the signature of TypeVarType was changed to only accept TypeVarId. Previously it accepted TypeVarId | int and did an auto-conversion if an int was passed.

if isinstance(id, int):
    id = TypeVarId(id)

This will break with the next release of mypy. Thus a new pydantic release would be much appreciated.

Related issue number

--

Checklist

  • The pull request title is a good summary of the changes - it will be used in the changelog
  • Unit tests for the changes exist
  • Tests pass on CI
  • Documentation reflects the changes where applicable
  • My PR is ready to review, please add a comment including the phrase "please review" to assign reviewers

Skip change file check

Selected Reviewer: @hramezani

@cdce8p
Copy link
Contributor Author

cdce8p commented Jun 6, 2024

please review

@sydney-runkle
Copy link
Member

@cdce8p,

Thanks for your PR. Let's have @dmontagu take a look!

Copy link
Member

@sydney-runkle sydney-runkle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, thank you!

@sydney-runkle sydney-runkle merged commit 9eaa67b into pydantic:1.10.X-fixes Jun 6, 2024
49 checks passed
@cdce8p cdce8p deleted the fix-mypy-v2 branch June 6, 2024 13:14
@cdce8p
Copy link
Contributor Author

cdce8p commented Jun 6, 2024

Thanks for the quick review @sydney-runkle!

Should I open another PR against main to fix that in the v1 package?
It isn't an issue for the main / v2 AFAICT.

If possible, it would be real awesome to get a 1.10.16 release soon. That way it will be ready in time for the next mypy release.

@sydney-runkle
Copy link
Member

@cdce8p,

All good, we'll release from 1.10.X and pull that into main when we do the new release!

I can get one ready next week - we're halting V1 support after June 30th though, just FYI!

@cdce8p
Copy link
Contributor Author

cdce8p commented Jun 6, 2024

All good, we'll release from 1.10.X and pull that into main when we do the new release!

I can get one ready next week - we're halting V1 support after June 30th though, just FYI!

Thanks for the info @sydney-runkle! That's a bit unfortunate sadly. E.g. for Home Assistant we're still stuck on 1.10.x due to many different blockers (from upstream packages). It just means that for future mypy incompatibilities I'll have to inline the pydantic plugin instead of contribution it upstream which I much prefer.

Thankfully those are rather rare though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants