Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

⬆️ Add support for Python 3.14 - #1578

#1578
Merged
tiangolo merged 16 commits into
fastapi:mainfastapi/sqlmodel:mainfrom
svlandeg:feat/py314svlandeg/sqlmodel:feat/py314Copy head branch name to clipboard
Oct 8, 2025
Merged

⬆️ Add support for Python 3.14#1578
tiangolo merged 16 commits into
fastapi:mainfastapi/sqlmodel:mainfrom
svlandeg:feat/py314svlandeg/sqlmodel:feat/py314Copy head branch name to clipboard

Conversation

@svlandeg

@svlandeg svlandeg commented Sep 26, 2025

Copy link
Copy Markdown
Member

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
@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@svlandeg

svlandeg commented Sep 26, 2025

Copy link
Copy Markdown
Member Author

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

[UPDATE]: done ✔️

@github-actions

github-actions Bot commented Oct 8, 2025

Copy link
Copy Markdown
Contributor

📝 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
Comment thread sqlmodel/_compat.py

@tiangolo tiangolo left a comment

Copy link
Copy Markdown
Member

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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.