From b74343321d611bf75b8d74d164aae0f56b5d95f9 Mon Sep 17 00:00:00 2001 From: Josh Zhang <39790535+jiashuoz@users.noreply.github.com> Date: Sat, 10 Oct 2026 16:14:16 +0800 Subject: [PATCH] fix(sdk/python): keep the dev install below pydantic 2.14 for the 3.9 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 --- sdks/python/pyproject.toml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sdks/python/pyproject.toml b/sdks/python/pyproject.toml index 67175d77f..9162b6631 100644 --- a/sdks/python/pyproject.toml +++ b/sdks/python/pyproject.toml @@ -52,7 +52,14 @@ Repository = "https://github.com/tokencanopy/e2a" Documentation = "https://e2a.dev" [project.optional-dependencies] -dev = ["pytest>=7", "pytest-cov>=5", "pytest-httpx", "anyio[trio]", "pyyaml>=6", "build", "twine", "mypy>=1.10,<1.19"] +# pydantic<2.14 here is for the mypy gate, not a runtime constraint: [tool.mypy] +# checks under python_version 3.9 and follows imports into the installed +# pydantic, while CI installs on 3.12. pydantic 2.14 requires Python >=3.10 and +# uses `match` statements, which that 3.9 grammar rejects ("Pattern matching is +# only supported in Python 3.10 and greater"). A real 3.9 user resolves 2.13.x, +# so the dev install stays at what they get. Drop the cap when requires-python +# moves to >=3.10. +dev = ["pytest>=7", "pytest-cov>=5", "pytest-httpx", "anyio[trio]", "pyyaml>=6", "build", "twine", "mypy>=1.10,<1.19", "pydantic<2.14"] ws = ["websockets>=14"] # Unit-test coverage gate (pytest-cov). The OpenAPI-Generator client base under