Skip to content

Conversation

svlandeg
Copy link
Member

@svlandeg svlandeg commented Sep 26, 2025

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 empty dict in class_dict["annotations"], which will ultimately result in a pydantic.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)

@svlandeg svlandeg self-assigned this Sep 26, 2025

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.

@svlandeg
Copy link
Member Author

svlandeg commented Sep 26, 2025

It looks like we'll need to bump mypy first...

[UPDATE]: done ✔️

Copy link
Contributor

github-actions bot commented Oct 8, 2025

📝 Docs preview

Last commit 215d02d at: https://d3498ba3.sqlmodel.pages.dev

@svlandeg svlandeg marked this pull request as ready for review October 8, 2025 14:09
@svlandeg svlandeg removed their assignment Oct 8, 2025
Copy link
Member

@tiangolo tiangolo left a 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. 🎉

@tiangolo tiangolo merged commit 45215fc into fastapi:main Oct 8, 2025
25 checks passed
@svlandeg svlandeg deleted the feat/py314 branch October 8, 2025 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants