From 19a2a9228eae59b410acdd6ac8b5a215686e762d Mon Sep 17 00:00:00 2001 From: zhaoruizhe Date: Tue, 13 Oct 2026 20:38:45 +0800 Subject: [PATCH] Python: declare anthropic boto3/google-auth as dev dependency group Per review feedback, boto3 and google-auth are not runtime dependencies of agent-framework-anthropic: boto3 is an ImportError-fallback optional import in _bedrock_client.py and google-auth only appears in _vertex_client.py type annotations. Shipping them to every agent-framework-anthropic install would burden Anthropic-only users. Move both into a PEP 735 [dependency-groups] dev group (same pattern as packages/core). The dependency-bounds probe installs declared groups, so the isolated pyright pass still resolves both imports and the bounds test passes; the base install stays slim. uv.lock regenerated with the repo-pinned uv 0.12.23 (required-version now enforced on main); validate_dependency_bounds --mode test --package anthropic passes lower and upper scenarios. --- python/packages/anthropic/pyproject.toml | 10 ++++++++++ python/uv.lock | 12 ++++++++++++ 2 files changed, 22 insertions(+) diff --git a/python/packages/anthropic/pyproject.toml b/python/packages/anthropic/pyproject.toml index 57e669ec281..c3fe2742093 100644 --- a/python/packages/anthropic/pyproject.toml +++ b/python/packages/anthropic/pyproject.toml @@ -27,6 +27,16 @@ dependencies = [ "anthropic>=1.11.0,<2", ] +[dependency-groups] +# boto3 is an ImportError-fallback optional import in _bedrock_client.py and +# google-auth only appears in _vertex_client.py type annotations, so neither is +# a runtime dependency. They are declared here so isolated source checks (the +# dependency-bounds pyright probes) can resolve their APIs. +dev = [ + "boto3>=1.35.0,<2.0.0", + "google-auth>=2.0.0,<3.0.0", +] + [tool.uv] prerelease = "if-necessary" environments = [ diff --git a/python/uv.lock b/python/uv.lock index 13726f1d35c..8d48f86d5ad 100644 --- a/python/uv.lock +++ b/python/uv.lock @@ -239,12 +239,24 @@ dependencies = [ { name = "anthropic" }, ] +[package.dev-dependencies] +dev = [ + { name = "boto3" }, + { name = "google-auth" }, +] + [package.metadata] requires-dist = [ { name = "agent-framework-core", editable = "packages/core" }, { name = "anthropic", specifier = ">=1.11.0,<2" }, ] +[package.metadata.requires-dev] +dev = [ + { name = "boto3", specifier = ">=1.35.0,<2.0.0" }, + { name = "google-auth", specifier = ">=2.0.0,<3.0.0" }, +] + [[package]] name = "agent-framework-azure-ai-search" version = "1.0.0b261002"