Repository navigation
fix(sdk/python): keep the dev install below pydantic 2.14 for the 3.9 mypy gate - #1077
Merged
Merged
Conversation
… mypy gate pydantic 2.14.0 (2026-10-08) requires Python >=3.10 and uses match statements. The SDK's mypy gate checks under python_version 3.9 and follows imports into the installed pydantic, so every CI run now fails inside pydantic/json_schema.py with "Pattern matching is only supported in Python 3.10 and greater". A real 3.9 user resolves pydantic 2.13.x; cap the dev extra there so the gate installs what they get. Runtime constraint unchanged. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Problem
Every PR's Python SDK tests job fails since 2026-10-08:
pydantic 2.14.0 (released 2026-10-08) requires Python >=3.10 and uses
matchstatements.[tool.mypy]checks underpython_version = "3.9"and follows imports into the installed pydantic, while CI installs on 3.12, so mypy parses 2.14's source with the 3.9 grammar. The last greenmainrun (2026-10-06) predates the release.Fix
Add
pydantic<2.14to thedevextra only, with a comment explaining why. A real Python 3.9 user already resolves pydantic 2.13.x, so the gate now installs what they get. The runtime constraintpydantic>=2.12,<3is unchanged. Drop the cap whenrequires-pythonmoves to >=3.10.Verified
Fresh 3.12 venv,
pip install -e ".[dev]"resolves pydantic 2.13.5,mypy→Success: no issues found in 4 source files.🤖 Generated with Claude Code