chore(deps): drop unused runtime deps and exclude tests from wheel#367
Merged
Merged
Conversation
Audit (AGX1-292) found that the published wheel declared 8 deps with zero import sites in `src/`, plus shipped its own test files under `src/agentex/lib/.../tests/` — which forced `pytest` and `pytest-asyncio` to appear as runtime deps. Dropped: tornado, ipykernel, tzlocal, tzdata, datadog, anthropic, pytest, pytest-asyncio. Also strips the `[cli]` extra from `mcp` (only `StdioServerParameters` is imported). Hatchling wheel `exclude` added so the test trees stop shipping. The Jinja templates under `lib/cli/templates/**/test_agent.py.j2` are intentionally preserved — they render into scaffolded user projects. Verified locally: - `Requires-Dist` count 44 → 37 - Test files in wheel 24 → 0 - `.j2` agent templates still present (10) Follow-ups in AGX1-292: extras-based split of ADK/server deps, and lazy imports under `agentex.lib.adk` to keep that safe. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
7 tasks
max-parke-scale
added a commit
that referenced
this pull request
May 26, 2026
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 a single `[adk]` optional extra. The current install behavior is recoverable with `pip install agentex-sdk[adk]`. BREAKING CHANGE: consumers who rely on `agentex.lib.*` (CLI, ADK, fastacp, temporal, providers) must switch from `agentex-sdk` to `agentex-sdk[adk]`. 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 == 'adk'`: 31 - Bare install pulls ~6 packages instead of ~hundreds. Stacked on AGX1-292 / #367 (drop unused deps). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
declan-scale
approved these changes
May 26, 2026
max-parke-scale
added a commit
that referenced
this pull request
May 26, 2026
…bility] extras 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 / #367 (drop unused deps). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3 tasks
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
First of a planned set under AGX1-292. Zero-risk wins.
The published
agentex-sdkwheel declares 44 required runtime deps. Audit found that 8 of them are imported nowhere insrc/and 2 more (pytest,pytest-asyncio) are only used by test files we accidentally ship inside the wheel.Dropped (zero imports anywhere in
src/agentex/**)anthropic>=0.40.0claude-agent-sdkif a consumer actually uses it.datadog>=0.52.1ddtrace(kept).tornado>=6.5.5ipykernel; both unused.ipykernel>=6.29.5tzlocal>=5.3.1tzdata>=2025.2temporaliowill pull what it needs.Tests stop shipping in the wheel
hatchling'spackages = ["src/agentex"]was including 24 test files (tests/,conftest.py,pytest.ini,test_*.py) undersrc/agentex/lib/. Those forcedpytest+pytest-asynciointo the runtime metadata. Added anexcludeto the wheel target so they stop shipping; dropped both deps.The Jinja templates at
lib/cli/templates/**/test_agent.py.j2are intentionally preserved — those render into scaffolded user projects and don't end in.py.mcp[cli]→mcpThe
[cli]extra ofmcppullstyper/rich/pyperclipfor themcp devCLI; the SDK only usesfrom mcp import StdioServerParameters.Verification
Test plan
Validate PR titlepasses.Requires-Distregression in the published wheel after release.agentex-serverinstall (inscaleapi/scale-agentex) still resolves — the deps dropped here either weren't used or are transitively available via siblings (e.g.temporaliobrings tz data).Follow-ups (separate PRs)
[adk],[cli],[server],[temporal],[provider-*],[observability]).src/agentex/lib/adk/__init__.pyso the extras split is safe.Both tracked in AGX1-292.
Greptile Summary
This maintenance PR removes 8 runtime dependencies that have zero imports anywhere in
src/agentex/, downgradesmcp[cli]tomcp(since onlyStdioServerParametersis imported), and adds hatchlingexcluderules to stop test infrastructure files from shipping inside the published wheel.tornado,ipykernel,tzlocal,tzdata,datadog,anthropic,pytest,pytest-asyncio) were confirmed to have no direct imports insrc/agentex/**— grep returns zero matches for each.from mcp import StdioServerParameterscall sites are all in the coremcpnamespace, unaffected by dropping the[cli]extra.excludepatterns (lib/**/tests/**,lib/**/test_*.py,lib/**/conftest.py,lib/**/pytest.ini) correctly cover every test file currently present undersrc/agentex/lib/.Confidence Score: 5/5
Safe to merge — all removed packages are confirmed unused in src/ and the wheel exclude patterns cover every test file in the current codebase.
Every dropped dependency was verified to have zero direct imports in src/agentex. The mcp[cli]→mcp narrowing is backed by four call sites that exclusively import StdioServerParameters from the core namespace. The wheel exclude globs match all test files present under src/agentex/lib/, and the Jinja templates are correctly left untouched.
No files require special attention. pyproject.toml is the only changed file and the edits are straightforward.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[agentex-sdk wheel] --> B[Runtime deps kept] A --> C[Deps removed] A --> D[Wheel build target] B --> B1[mcp - StdioServerParameters only] B --> B2[claude-agent-sdk - transitively pulls anthropic] B --> B3[temporalio - transitively pulls tzdata] B --> B4[ddtrace - replaced datadog] C --> C1[tornado - security pin, unused] C --> C2[ipykernel - unused] C --> C3[tzlocal / tzdata - transitive via temporalio] C --> C4[datadog - confused with ddtrace] C --> C5[anthropic - transitive via claude-agent-sdk] C --> C6[pytest / pytest-asyncio - test-only] D --> E[packages = src/agentex] D --> F[exclude patterns added] F --> F1[lib/**/tests/**] F --> F2[lib/**/test_*.py] F --> F3[lib/**/conftest.py] F --> F4[lib/**/pytest.ini] F --> G[Jinja templates test_agent.py.j2 preserved]Reviews (1): Last reviewed commit: "chore(deps): drop unused runtime deps an..." | Re-trigger Greptile