Skip to content

fix(python-fastapi): update requirements for Python 3.14 support - #24790

Merged
wing328 merged 1 commit into
OpenAPITools:masterfrom
waterWang:fix/python-314-requirements
Aug 27, 2026
Merged

wing328 merged 1 commit into
OpenAPITools:masterfrom
waterWang:fix/python-314-requirements

Conversation

@waterWang

@waterWang waterWang commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Update the python-fastapi generator's requirements.txt template so the generated FastAPI server installs cleanly on Python 3.14.

Root cause: the template pins typing-extensions==4.13.2. Modern pydantic (2.13.x) requires typing-extensions>=4.14.1, so pip is forced to resolve an older pydantic, whose pydantic-core has no CPython 3.14 wheel — pip then tries to build it from source with an old PyO3 (0.24.1) that rejects Python 3.14, failing the pip install in Docker.

Changes (5 lines):

  • typing-extensions 4.13.2 → 4.16.0 — unlocks pydantic ≥ 2.13 (its pydantic-core ships a cp314 wheel)
  • httptools upper bound <0.7.0 → <0.9.0 — 0.7.1+/0.8.0 ship cp314 wheels (0.6.x has none)
  • uvloop 0.21.0 → 0.22.1 — first release with cp314 wheels
  • MarkupSafe 2.0.1 → 3.0.3 — first with cp314 wheels (2.0.1 has none)
  • orjson 3.11.6 → 3.12.0 — newer wheel coverage (3.11.6 already has cp314)

All upgraded packages still provide CPython 3.10 wheels (the sample CI matrix), verified via pip dry-run against the 3.10 and 3.14 manylinux targets; the local install + import smoke test on 3.11 passes (fastapi TestClient, pydantic 2.13.4, jinja2/markupsafe, httptools/orjson/uvloop).

Fixes #24788.


Summary by cubic

Updates the python-fastapi generator's requirements.mustache and sample requirements.txt so the generated FastAPI server installs cleanly on Python 3.14. The old pins forced pip to resolve an older pydantic whose pydantic-core has no CPython 3.14 wheel, so pip tried to build it from source and failed.

  • Bumping typing-extensions to 4.16.0 unlocks pydantic ≥ 2.13, which ships CPython 3.14 wheels.
  • Also bumps httptools, uvloop, MarkupSafe, and orjson to versions with CPython 3.14 wheels.
  • All upgraded packages still provide CPython 3.10 wheels, verified against the sample CI matrix; the install and import smoke test passes on 3.11. Fixes [BUG] python-fastapi requirements.txt incompatible with Python 3.14 #24788.

Written for commit 0690fa6. Summary will update on new commits.

Review in cubic

Bump typing-extensions to 4.16.0, httptools upper bound to <0.9.0,
orjson to 3.12.0, uvloop to 0.22.1 and MarkupSafe to 3.0.3 so that
the generated FastAPI server installs from prebuilt wheels on
Python 3.14 (drops the old pyo3-based pydantic-core fallback that
failed to compile). Fixes OpenAPITools#24788.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Re-trigger cubic

@wing328
wing328 merged commit 1edd5f2 into OpenAPITools:master Aug 27, 2026
16 checks passed
@wing328

wing328 commented Aug 27, 2026

Copy link
Copy Markdown
Member

thanks for the contribution, which has been merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] python-fastapi requirements.txt incompatible with Python 3.14

2 participants