Skip to content

fix(sdk/python): keep the dev install below pydantic 2.14 for the 3.9 mypy gate - #1077

Merged
jiashuoz merged 1 commit into
mainfrom
fix/python-sdk-mypy-pydantic-214
Oct 10, 2026
Merged

jiashuoz merged 1 commit into
mainfrom
fix/python-sdk-mypy-pydantic-214

Conversation

@jiashuoz

Copy link
Copy Markdown
Member

Problem

Every PR's Python SDK tests job fails since 2026-10-08:

pydantic/json_schema.py:2341: error: Pattern matching is only supported in Python 3.10 and greater  [syntax]

pydantic 2.14.0 (released 2026-10-08) requires Python >=3.10 and uses match statements. [tool.mypy] checks under python_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 green main run (2026-10-06) predates the release.

Fix

Add pydantic<2.14 to the dev extra 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 constraint pydantic>=2.12,<3 is unchanged. Drop the cap when requires-python moves 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

… 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>
@jiashuoz
jiashuoz merged commit b18415b into main Oct 10, 2026
24 checks passed
@jiashuoz
jiashuoz deleted the fix/python-sdk-mypy-pydantic-214 branch October 10, 2026 08:29
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.

1 participant