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 mypy 1.11 release #10139

Merged
merged 4 commits into from
Aug 15, 2024

Conversation

flaeppe
Copy link

@flaeppe flaeppe commented Aug 14, 2024

Change Summary

Repairs the mypy plugin for pydantic v1 by passing a namespace when defining a TypeVarId for mypy>=1.11. This is a continuation on the changes in #9586 which missed the new namespace argument from python/mypy#17311

I arrived at these changes by bisecting mypy, via my own project that got stuck at the issue in #10000, and ending up at python/mypy#17311.

python/mypy#17311 includes similar changes to the one found in here for mypy's attrs plugin:

https://github.com/python/mypy/blob/8332c6e7992fa9655b79ef55c410a805ad1e6d34/mypy/plugins/attrs.py#L841-L843

I know this is part of 1.10.x but I found the quite recent #10000 (comment) that you could consider a PR with a fix. I hope this is still OK. I'm also hoping I'm doing the right thing here by opening a PR towards 1.10.x-fixes instead of main.

Related issue number

fix #10000

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

@flaeppe
Copy link
Author

flaeppe commented Aug 14, 2024

please review

@sydney-runkle
Copy link
Member

@flaeppe,

Great work! Happy to merge, but we need to fix CI - could you please look into these failures?

@sydney-runkle sydney-runkle added the awaiting author revision awaiting changes from the PR author label Aug 15, 2024
@flaeppe
Copy link
Author

flaeppe commented Aug 15, 2024

"build" jobs seemed to have connection errors, retrial of those hopefully works, found this in the job logs:

  Unable to find image 'quay.io/pypa/manylinux2014_x86_64:2024-03-10-4935fcc' locally
  Error response from daemon: received unexpected HTTP status: 502 Bad Gateway

The lint step, twine check, I hunted down to pypa/twine#1125. Pinning importlib-metadata==7.2.1, one of twine's dependencies seems to have fixed the problem. Ref pypa/twine#1125 (comment)

@flaeppe
Copy link
Author

flaeppe commented Aug 15, 2024

Oh, wait, I missed that there was a 5.1.1 twine release already. Let's try if bumping twine works first.

@sydney-runkle
Copy link
Member

Oh, wait, I missed that there was a 5.1.1 twine release already. Let's try if bumping twine works first.

Awesome, thanks for digging around for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting author revision awaiting changes from the PR author ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants