Skip to content

Raise the pydantic floor so SDK generation installs on Python 3.14 - #186

Merged
chris-freeman-glean merged 1 commit into
mainfrom
cfreeman/pydantic-py314-floor-2ed4
Nov 9, 2026
Merged

chris-freeman-glean merged 1 commit into
mainfrom
cfreeman/pydantic-py314-floor-2ed4

Conversation

@chris-freeman-glean

Copy link
Copy Markdown
Contributor

Cause

Since 6 Nov 2026 12:43 PM MT, the floating speakeasy-api/sdk-generation-action@v15 image compiles on Python 3.14. poetry install still installs locked pydantic-core 2.33.1. That release has no cp314 wheel, and its PyO3 0.24.0 refuses to build on 3.14. Compile SDK fails and the action deletes the regen branch. That closed PR 185 and later regen runs, including https://github.com/gleanwork/api-client-python/actions/runs/42282076104.

Change

The Python generator hardcodes pydantic >=2.11.2 and rewrites pyproject.toml on every run. python.additionalDependencies.main.pydantic replaces that default, so regeneration keeps the new floor. The floor is >=2.12.0: pydantic 2.12.0 is the first release that depends on a core build with cp314 wheels (pydantic-core==2.41.1). cp314 wheels, including musllinux x86_64, start at pydantic-core 2.35.0. No 2.11 release moves off pydantic-core 2.33.x. requires-python stays >=3.10.

poetry.lock now resolves pydantic 2.14.3 and pydantic-core 2.50.4. Poetry 2.2.1 poetry lock keeps an already-valid pin, which is why the old 2.11.3 pin survived regeneration. The raised floor makes that pin invalid.

Validation

  • Python 3.10.22: poetry install used the cp310 manylinux wheel. poetry build, pytest (191 passed, 63 skipped), mypy, pyright, and pylint passed.
  • Python 3.14.10: poetry install used the cp314 manylinux wheel (not a source build). poetry build, mypy, pyright, and pylint passed. pytest: 190 passed, 63 skipped, 1 failed. test_chat_sdk_platform_chat_create fails because generated get_discriminator formats a str Enum with an f-string. On 3.14 that tag is PlatformChatJSONSchemaFormatType.JSON_SCHEMA instead of JSON_SCHEMA. The same test passed on 3.10. The current generator template still contains that f-string, so a patch in the generated file would be overwritten. Compile SDK does not run pytest.

Risk and revert

Consumers pinned to pydantic 2.11 will need pydantic >=2.12 when they upgrade this package. A plain revert restores the previous floor and brings the Compile SDK failure back. No API types or migrations change in this PR.

Open in Web Open in Cursor 

Speakeasy's compile image now runs Python 3.14, and poetry.lock still
pins pydantic 2.11.3 / pydantic-core 2.33.1. That core release has no
cp314 wheels, and PyO3 0.24.0 refuses to build it. Override the
generator's default dependency so regeneration keeps pydantic >=2.12.0,
and relock to a release that publishes 3.10 and 3.14 wheels.

Co-authored-by: Chris Freeman <chris-freeman-glean@users.noreply.github.com>
@chris-freeman-glean
chris-freeman-glean requested a review from a team as a code owner November 9, 2026 19:17
@chris-freeman-glean
chris-freeman-glean merged commit 8e67b56 into main Nov 9, 2026
9 checks passed
@chris-freeman-glean
chris-freeman-glean deleted the cfreeman/pydantic-py314-floor-2ed4 branch November 9, 2026 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants