-
-
Notifications
You must be signed in to change notification settings - Fork 769
⬆️ Add support for Python 3.14 #1578
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
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
It looks like we'll need to bump mypy first... [UPDATE]: done ✔️ |
📝 Docs previewLast commit 215d02d at: https://d3498ba3.sqlmodel.pages.dev |
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.
Nice! And now we get to use annotationlib
! 😎 🚀
I reviewed it thoroughly, read all the annotationlib
docs and best practices document, and the implementation in Pydatnic. It all looks good to me. 🎉
Adding support for Python 3.14 by expanding the test suite, adding the classifier, and fixing a compat issue with Pydantic.
Since pydantic/pydantic#11991 (Pydantic 2.12.0 for Python 3.14),
annotations
are retrieved differently. We need to do the same, or will end up with an emptydict
inclass_dict["annotations"]
, which will ultimately result in apydantic.errors.PydanticUserError
stating that a certain field requires a type annotation.The implementation here should be bwd-compat for previous versions of Pydantic v2 (tested locally).
Note that Pydantic v1 won't be supported on Python 3.14: pydantic/pydantic#11613 (comment)