From cf55c2878aabb7a348fbd2b11b659ff8d6c5de54 Mon Sep 17 00:00:00 2001 From: Michael Assraf Date: Sat, 25 Jul 2026 17:45:57 +0200 Subject: [PATCH] fix(deps): pin pydantic-ai to the 2.x major (<3.0) [preview:none] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pydantic-ai was unbounded (>=1.0.6), so pip pulled whatever latest was — that is how the OpenAIModel->OpenAIChatModel rename broke 'python -m codewiki' out of nowhere. The current fix targets the 2.x API; a future 3.x could rename again and break the import even with the try/except fallback (which expects the pre-2.x name). Pin >=2.0,<3.0 so majors are adopted deliberately, not silently. Co-Authored-By: Claude Opus 4.8 --- pyproject.toml | 2 +- requirements.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 00c3e01d..651408c4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,7 +42,7 @@ dependencies = [ "litellm>=1.77.0", "pydantic>=2.11.7", "pydantic-settings>=2.10.1", - "pydantic-ai>=1.0.6", + "pydantic-ai>=2.0,<3.0", "requests>=2.32.4", "python-dotenv>=1.1.1", "rich>=14.1.0", diff --git a/requirements.txt b/requirements.txt index 5b770d9a..993722f3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -105,8 +105,8 @@ pyasn1_modules==0.4.2 pycares==4.11.0 pycparser==2.23 pydantic==2.11.7 -pydantic-ai>=1.37.0 -pydantic-ai-slim>=1.37.0 +pydantic-ai>=2.0,<3.0 +pydantic-ai-slim>=2.0,<3.0 pydantic-evals>=1.37.0 pydantic-graph>=1.37.0 pydantic-settings==2.10.1