⬆️ Add support for Python 3.14#1578
Merged
tiangolo merged 16 commits intofastapi:mainfrom Oct 8, 2025
Merged
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.
Member
Author
|
It looks like we'll need to bump mypy first... [UPDATE]: done ✔️ |
This was referenced Oct 7, 2025
Contributor
📝 Docs previewLast commit 215d02d at: https://d3498ba3.sqlmodel.pages.dev |
svlandeg
commented
Oct 8, 2025
tiangolo
approved these changes
Oct 8, 2025
Member
tiangolo
left a comment
There was a problem hiding this comment.
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. 🎉
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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),
annotationsare retrieved differently. We need to do the same, or will end up with an emptydictinclass_dict["annotations"], which will ultimately result in apydantic.errors.PydanticUserErrorstating 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)