From d40200b1d0876fcf49349f962870037a59fbff27 Mon Sep 17 00:00:00 2001 From: Max Parke Date: Tue, 26 May 2026 16:57:05 -0400 Subject: [PATCH] feat(deps)!: split ADK/server deps into optional [adk]/[cli]/[observability] extras MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bare `pip install agentex-sdk` now installs only the 6 deps the Stainless-generated REST client actually needs (`httpx`, `pydantic`, `typing-extensions`, `anyio`, `distro`, `sniffio`). Everything used by the `agentex.lib.*` surface — CLI, ACP server, Temporal workflows, LLM provider integrations, observability — moves to optional extras. Three extras for different consumer slices: - `[cli]` (11 deps) — `agentex.lib.cli.*`, `agentex.lib.sdk.config.*`, and the `agentex` CLI entry point. For tools like sgpctl that need the CLI helpers without temporal/fastapi/redis. - `[observability]` (4 deps) — `agentex.lib.core.tracing.*`, `agentex.lib.core.observability.*`. For consumers that only attach the SGP/Datadog/OTel tracing processors. - `[adk]` (31 deps) — union of [cli] + [observability] + ACP server + Temporal + Redis + MCP + LLM providers. Full agent authoring. The current install behavior is recoverable with `pip install agentex-sdk[adk]`. CLI templates (`agentex init`) are updated to pin `agentex-sdk[adk]` so newly bootstrapped agents work out of the box. BREAKING CHANGE: consumers who rely on `agentex.lib.*` must pin one of the new extras instead of bare `agentex-sdk`. The REST client surface (`from agentex import Agentex, AsyncAgentex`) is unchanged and still works with a bare install. Verified by building the wheel locally: - `Requires-Dist` (base): 6 - `Requires-Dist; extra == 'cli'`: 11 - `Requires-Dist; extra == 'observability'`: 4 - `Requires-Dist; extra == 'adk'`: 31 Stacked on AGX1-292 / scaleapi/scale-agentex-python#367 (drop unused deps). Co-Authored-By: Claude Opus 4.7 (1M context) --- pyproject.toml | 93 ++++++++++++------- .../default-langgraph/pyproject.toml.j2 | 2 +- .../default-langgraph/requirements.txt.j2 | 2 +- .../default-pydantic-ai/pyproject.toml.j2 | 2 +- .../default-pydantic-ai/requirements.txt.j2 | 2 +- .../cli/templates/default/pyproject.toml.j2 | 2 +- .../cli/templates/default/requirements.txt.j2 | 2 +- .../sync-langgraph/pyproject.toml.j2 | 2 +- .../sync-langgraph/requirements.txt.j2 | 2 +- .../sync-openai-agents/pyproject.toml.j2 | 2 +- .../sync-openai-agents/requirements.txt.j2 | 2 +- .../sync-pydantic-ai/pyproject.toml.j2 | 2 +- .../sync-pydantic-ai/requirements.txt.j2 | 2 +- .../lib/cli/templates/sync/pyproject.toml.j2 | 2 +- .../cli/templates/sync/requirements.txt.j2 | 2 +- .../temporal-openai-agents/pyproject.toml.j2 | 2 +- .../requirements.txt.j2 | 2 +- .../temporal-pydantic-ai/pyproject.toml.j2 | 2 +- .../temporal-pydantic-ai/requirements.txt.j2 | 2 +- .../cli/templates/temporal/pyproject.toml.j2 | 2 +- .../templates/temporal/requirements.txt.j2 | 2 +- 21 files changed, 81 insertions(+), 52 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 662f72ea9..393bcb912 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,6 +8,9 @@ authors = [ { name = "Agentex", email = "roxanne.farhad@scale.com" }, ] +# Bare client surface only — the Stainless-generated REST client +# (`from agentex import Agentex, AsyncAgentex`). Everything else lives +# under the `[adk]` extra; see [project.optional-dependencies] below. dependencies = [ "httpx>=0.28.1,<0.29", "pydantic>=2.0.0, <3", @@ -15,37 +18,6 @@ dependencies = [ "anyio>=3.5.0, <5", "distro>=1.7.0, <2", "sniffio", - "typer>=0.16,<0.17", - "questionary>=2.0.1,<3", - "rich>=13.9.2,<14", - "fastapi>=0.115.0", - "starlette>=0.49.1", - "uvicorn>=0.31.1", - "watchfiles>=0.24.0,<1.0", - "python-on-whales>=0.73.0,<0.74", - "pyyaml>=6.0.2,<7", - "jsonschema>=4.23.0,<5", - "jsonref>=1.1.0,<2", - "temporalio>=1.26.0,<2", - "aiohttp>=3.10.10,<4", - "redis>=5.2.0,<8", - "litellm>=1.83.7,<2", - "kubernetes>=25.0.0,<36.0.0", - "jinja2>=3.1.3,<4", - "mcp>=1.4.1", - "scale-gp>=0.1.0a59", - "openai-agents==0.14.1", - "pydantic-ai-slim>=1.0,<2", - "json_log_formatter>=1.1.1", - "scale-gp-beta>=0.2.0", - "openai>=2.2,<3", # Required by openai-agents; litellm now supports openai 2.x (issue #13711 resolved: https://github.com/BerriAI/litellm/issues/13711) - "cloudpickle>=3.1.1", - "ddtrace>=3.13.0", - "yaspin>=3.1.0", - "claude-agent-sdk>=0.1.0", - "langgraph-checkpoint>=2.0.0", - "opentelemetry-sdk>=1.20.0", - "opentelemetry-api>=1.20.0", ] requires-python = ">= 3.11,<4" @@ -70,7 +42,64 @@ Homepage = "https://github.com/scaleapi/scale-agentex-python" Repository = "https://github.com/scaleapi/scale-agentex-python" [project.optional-dependencies] -aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.9"] +# httpx-aiohttp transport. Independent from `[adk]`. +aiohttp = ["aiohttp>=3.10.10,<4", "httpx_aiohttp>=0.1.9"] + +# CLI surface — what `agentex.lib.cli.*` and `agentex.lib.sdk.config.*` need. +# Consumers that import only `agentex.lib.cli.handlers`, `agentex.lib.sdk.config`, +# or use the `agentex` CLI entry point can pin `agentex-sdk[cli]` instead of the +# full `[adk]` extra. +cli = [ + "typer>=0.16,<0.17", + "questionary>=2.0.1,<3", + "rich>=13.9.2,<14", + "yaspin>=3.1.0", + "pyyaml>=6.0.2,<7", + "python-on-whales>=0.73.0,<0.74", + "kubernetes>=25.0.0,<36.0.0", + "jsonref>=1.1.0,<2", + "jsonschema>=4.23.0,<5", + "jinja2>=3.1.3,<4", + "watchfiles>=0.24.0,<1.0", +] + +# Tracing / observability — what `agentex.lib.core.tracing.*` and +# `agentex.lib.core.observability.*` need. Consumers that only attach the +# SGP/Datadog/OTel tracing processors can pin `agentex-sdk[observability]`. +observability = [ + "ddtrace>=3.13.0", + "opentelemetry-api>=1.20.0", + "opentelemetry-sdk>=1.20.0", + "json_log_formatter>=1.1.1", +] + +# Full ADK surface — everything under `agentex.lib.*`. Includes [cli] + +# [observability] plus the ACP server, Temporal, Redis streaming, LLM provider +# integrations, and MCP. Required for full agent authoring. +adk = [ + "agentex-sdk[cli,observability]", + # ACP server (FastAPI app surface) + "fastapi>=0.115.0", + "starlette>=0.49.1", + "uvicorn>=0.31.1", + "aiohttp>=3.10.10,<4", + # Temporal workflows + "temporalio>=1.26.0,<2", + "cloudpickle>=3.1.1", + # Async streaming infra + "redis>=5.2.0,<8", + # LLM provider integrations + "litellm>=1.83.7,<2", + "openai-agents==0.14.1", + "openai>=2.2,<3", # Required by openai-agents; litellm now supports openai 2.x (issue #13711 resolved: https://github.com/BerriAI/litellm/issues/13711) + "claude-agent-sdk>=0.1.0", + "pydantic-ai-slim>=1.0,<2", + "langgraph-checkpoint>=2.0.0", + "scale-gp>=0.1.0a59", + "scale-gp-beta>=0.2.0", + "mcp>=1.4.1", +] + dev = [ "ruff>=0.3.4", ] diff --git a/src/agentex/lib/cli/templates/default-langgraph/pyproject.toml.j2 b/src/agentex/lib/cli/templates/default-langgraph/pyproject.toml.j2 index 3c752f025..cf660c312 100644 --- a/src/agentex/lib/cli/templates/default-langgraph/pyproject.toml.j2 +++ b/src/agentex/lib/cli/templates/default-langgraph/pyproject.toml.j2 @@ -8,7 +8,7 @@ version = "0.1.0" description = "{{ description }}" requires-python = ">=3.12" dependencies = [ - "agentex-sdk", + "agentex-sdk[adk]", "scale-gp", "langgraph", "langchain-openai", diff --git a/src/agentex/lib/cli/templates/default-langgraph/requirements.txt.j2 b/src/agentex/lib/cli/templates/default-langgraph/requirements.txt.j2 index 4a148e901..f88074f03 100644 --- a/src/agentex/lib/cli/templates/default-langgraph/requirements.txt.j2 +++ b/src/agentex/lib/cli/templates/default-langgraph/requirements.txt.j2 @@ -1,5 +1,5 @@ # Install agentex-sdk from local path -agentex-sdk +agentex-sdk[adk] # Scale GenAI Platform Python SDK scale-gp diff --git a/src/agentex/lib/cli/templates/default-pydantic-ai/pyproject.toml.j2 b/src/agentex/lib/cli/templates/default-pydantic-ai/pyproject.toml.j2 index 8881c5b74..cf5a4a917 100644 --- a/src/agentex/lib/cli/templates/default-pydantic-ai/pyproject.toml.j2 +++ b/src/agentex/lib/cli/templates/default-pydantic-ai/pyproject.toml.j2 @@ -8,7 +8,7 @@ version = "0.1.0" description = "{{ description }}" requires-python = ">=3.12" dependencies = [ - "agentex-sdk", + "agentex-sdk[adk]", "scale-gp", "pydantic-ai-slim[openai]>=1.0,<2", "python-dotenv", diff --git a/src/agentex/lib/cli/templates/default-pydantic-ai/requirements.txt.j2 b/src/agentex/lib/cli/templates/default-pydantic-ai/requirements.txt.j2 index 75e880b53..5f23533c9 100644 --- a/src/agentex/lib/cli/templates/default-pydantic-ai/requirements.txt.j2 +++ b/src/agentex/lib/cli/templates/default-pydantic-ai/requirements.txt.j2 @@ -1,5 +1,5 @@ # Install agentex-sdk from local path -agentex-sdk +agentex-sdk[adk] # Scale GenAI Platform Python SDK scale-gp diff --git a/src/agentex/lib/cli/templates/default/pyproject.toml.j2 b/src/agentex/lib/cli/templates/default/pyproject.toml.j2 index 34e04e6a4..d20835cb6 100644 --- a/src/agentex/lib/cli/templates/default/pyproject.toml.j2 +++ b/src/agentex/lib/cli/templates/default/pyproject.toml.j2 @@ -8,7 +8,7 @@ version = "0.1.0" description = "{{ description }}" requires-python = ">=3.12" dependencies = [ - "agentex-sdk", + "agentex-sdk[adk]", "scale-gp", ] diff --git a/src/agentex/lib/cli/templates/default/requirements.txt.j2 b/src/agentex/lib/cli/templates/default/requirements.txt.j2 index 0b8ae19b3..804425dc7 100644 --- a/src/agentex/lib/cli/templates/default/requirements.txt.j2 +++ b/src/agentex/lib/cli/templates/default/requirements.txt.j2 @@ -1,5 +1,5 @@ # Install agentex-sdk from local path -agentex-sdk +agentex-sdk[adk] # Scale GenAI Platform Python SDK scale-gp diff --git a/src/agentex/lib/cli/templates/sync-langgraph/pyproject.toml.j2 b/src/agentex/lib/cli/templates/sync-langgraph/pyproject.toml.j2 index 3c752f025..cf660c312 100644 --- a/src/agentex/lib/cli/templates/sync-langgraph/pyproject.toml.j2 +++ b/src/agentex/lib/cli/templates/sync-langgraph/pyproject.toml.j2 @@ -8,7 +8,7 @@ version = "0.1.0" description = "{{ description }}" requires-python = ">=3.12" dependencies = [ - "agentex-sdk", + "agentex-sdk[adk]", "scale-gp", "langgraph", "langchain-openai", diff --git a/src/agentex/lib/cli/templates/sync-langgraph/requirements.txt.j2 b/src/agentex/lib/cli/templates/sync-langgraph/requirements.txt.j2 index 4a148e901..f88074f03 100644 --- a/src/agentex/lib/cli/templates/sync-langgraph/requirements.txt.j2 +++ b/src/agentex/lib/cli/templates/sync-langgraph/requirements.txt.j2 @@ -1,5 +1,5 @@ # Install agentex-sdk from local path -agentex-sdk +agentex-sdk[adk] # Scale GenAI Platform Python SDK scale-gp diff --git a/src/agentex/lib/cli/templates/sync-openai-agents/pyproject.toml.j2 b/src/agentex/lib/cli/templates/sync-openai-agents/pyproject.toml.j2 index 34e04e6a4..d20835cb6 100644 --- a/src/agentex/lib/cli/templates/sync-openai-agents/pyproject.toml.j2 +++ b/src/agentex/lib/cli/templates/sync-openai-agents/pyproject.toml.j2 @@ -8,7 +8,7 @@ version = "0.1.0" description = "{{ description }}" requires-python = ">=3.12" dependencies = [ - "agentex-sdk", + "agentex-sdk[adk]", "scale-gp", ] diff --git a/src/agentex/lib/cli/templates/sync-openai-agents/requirements.txt.j2 b/src/agentex/lib/cli/templates/sync-openai-agents/requirements.txt.j2 index 0b8ae19b3..804425dc7 100644 --- a/src/agentex/lib/cli/templates/sync-openai-agents/requirements.txt.j2 +++ b/src/agentex/lib/cli/templates/sync-openai-agents/requirements.txt.j2 @@ -1,5 +1,5 @@ # Install agentex-sdk from local path -agentex-sdk +agentex-sdk[adk] # Scale GenAI Platform Python SDK scale-gp diff --git a/src/agentex/lib/cli/templates/sync-pydantic-ai/pyproject.toml.j2 b/src/agentex/lib/cli/templates/sync-pydantic-ai/pyproject.toml.j2 index e3c57647f..91a04bc3a 100644 --- a/src/agentex/lib/cli/templates/sync-pydantic-ai/pyproject.toml.j2 +++ b/src/agentex/lib/cli/templates/sync-pydantic-ai/pyproject.toml.j2 @@ -8,7 +8,7 @@ version = "0.1.0" description = "{{ description }}" requires-python = ">=3.12" dependencies = [ - "agentex-sdk", + "agentex-sdk[adk]", "scale-gp", "pydantic-ai-slim[openai]>=1.0,<2", ] diff --git a/src/agentex/lib/cli/templates/sync-pydantic-ai/requirements.txt.j2 b/src/agentex/lib/cli/templates/sync-pydantic-ai/requirements.txt.j2 index 5a812a218..3a263ef0d 100644 --- a/src/agentex/lib/cli/templates/sync-pydantic-ai/requirements.txt.j2 +++ b/src/agentex/lib/cli/templates/sync-pydantic-ai/requirements.txt.j2 @@ -1,5 +1,5 @@ # Install agentex-sdk from local path -agentex-sdk +agentex-sdk[adk] # Scale GenAI Platform Python SDK scale-gp diff --git a/src/agentex/lib/cli/templates/sync/pyproject.toml.j2 b/src/agentex/lib/cli/templates/sync/pyproject.toml.j2 index 34e04e6a4..d20835cb6 100644 --- a/src/agentex/lib/cli/templates/sync/pyproject.toml.j2 +++ b/src/agentex/lib/cli/templates/sync/pyproject.toml.j2 @@ -8,7 +8,7 @@ version = "0.1.0" description = "{{ description }}" requires-python = ">=3.12" dependencies = [ - "agentex-sdk", + "agentex-sdk[adk]", "scale-gp", ] diff --git a/src/agentex/lib/cli/templates/sync/requirements.txt.j2 b/src/agentex/lib/cli/templates/sync/requirements.txt.j2 index 0b8ae19b3..804425dc7 100644 --- a/src/agentex/lib/cli/templates/sync/requirements.txt.j2 +++ b/src/agentex/lib/cli/templates/sync/requirements.txt.j2 @@ -1,5 +1,5 @@ # Install agentex-sdk from local path -agentex-sdk +agentex-sdk[adk] # Scale GenAI Platform Python SDK scale-gp diff --git a/src/agentex/lib/cli/templates/temporal-openai-agents/pyproject.toml.j2 b/src/agentex/lib/cli/templates/temporal-openai-agents/pyproject.toml.j2 index a1ebab933..c47bea8d9 100644 --- a/src/agentex/lib/cli/templates/temporal-openai-agents/pyproject.toml.j2 +++ b/src/agentex/lib/cli/templates/temporal-openai-agents/pyproject.toml.j2 @@ -8,7 +8,7 @@ version = "0.1.0" description = "{{ description }}" requires-python = ">=3.12" dependencies = [ - "agentex-sdk", + "agentex-sdk[adk]", "scale-gp", "temporalio", "openai-agents>=0.4.2", diff --git a/src/agentex/lib/cli/templates/temporal-openai-agents/requirements.txt.j2 b/src/agentex/lib/cli/templates/temporal-openai-agents/requirements.txt.j2 index d4bd7a0fa..3f4d0a897 100644 --- a/src/agentex/lib/cli/templates/temporal-openai-agents/requirements.txt.j2 +++ b/src/agentex/lib/cli/templates/temporal-openai-agents/requirements.txt.j2 @@ -1,4 +1,4 @@ -agentex-sdk +agentex-sdk[adk] scale-gp temporalio openai-agents>=0.4.2 diff --git a/src/agentex/lib/cli/templates/temporal-pydantic-ai/pyproject.toml.j2 b/src/agentex/lib/cli/templates/temporal-pydantic-ai/pyproject.toml.j2 index e95df9e7b..9ae3e0193 100644 --- a/src/agentex/lib/cli/templates/temporal-pydantic-ai/pyproject.toml.j2 +++ b/src/agentex/lib/cli/templates/temporal-pydantic-ai/pyproject.toml.j2 @@ -8,7 +8,7 @@ version = "0.1.0" description = "{{ description }}" requires-python = ">=3.12" dependencies = [ - "agentex-sdk", + "agentex-sdk[adk]", "scale-gp", "temporalio>=1.18.2", "pydantic-ai-slim[openai]>=1.0,<2", diff --git a/src/agentex/lib/cli/templates/temporal-pydantic-ai/requirements.txt.j2 b/src/agentex/lib/cli/templates/temporal-pydantic-ai/requirements.txt.j2 index b2c95f02f..cac776e03 100644 --- a/src/agentex/lib/cli/templates/temporal-pydantic-ai/requirements.txt.j2 +++ b/src/agentex/lib/cli/templates/temporal-pydantic-ai/requirements.txt.j2 @@ -1,4 +1,4 @@ -agentex-sdk +agentex-sdk[adk] scale-gp temporalio>=1.18.2 pydantic-ai-slim[openai]>=1.0,<2 diff --git a/src/agentex/lib/cli/templates/temporal/pyproject.toml.j2 b/src/agentex/lib/cli/templates/temporal/pyproject.toml.j2 index 9e157aa48..bf09bd0b6 100644 --- a/src/agentex/lib/cli/templates/temporal/pyproject.toml.j2 +++ b/src/agentex/lib/cli/templates/temporal/pyproject.toml.j2 @@ -8,7 +8,7 @@ version = "0.1.0" description = "{{ description }}" requires-python = ">=3.12" dependencies = [ - "agentex-sdk", + "agentex-sdk[adk]", "scale-gp", "temporalio", ] diff --git a/src/agentex/lib/cli/templates/temporal/requirements.txt.j2 b/src/agentex/lib/cli/templates/temporal/requirements.txt.j2 index 0b8ae19b3..804425dc7 100644 --- a/src/agentex/lib/cli/templates/temporal/requirements.txt.j2 +++ b/src/agentex/lib/cli/templates/temporal/requirements.txt.j2 @@ -1,5 +1,5 @@ # Install agentex-sdk from local path -agentex-sdk +agentex-sdk[adk] # Scale GenAI Platform Python SDK scale-gp