Skip to content

Python templates install unused and provider-irrelevant dependencies #327

@notgitika

Description

@notgitika

Description

Python project templates vended by agentcore create include unnecessary dependencies in their pyproject.toml files:

  1. python-dotenv is listed as a dependency in all 6 framework templates (Strands, LangChain/LangGraph, CrewAI, Google ADK, OpenAI Agents, AutoGen), but it is never imported in any template Python code. Environment variable loading from .env files is handled by the agentcore dev CLI command, not by the agent code itself.

  2. Strands template unconditionally installs anthropic, google-genai, and openai SDK packages regardless of which modelProvider the user selected. For example, a user who selects Bedrock as their provider still gets anthropic, google-genai, and openai installed.

This bloats the user's virtual environment with packages they don't need, increasing install time and dependency surface area.

Steps to Reproduce

  1. Run agentcore create and select any Python framework (e.g., Strands) with the Bedrock model provider
  2. Inspect the generated pyproject.toml in the agent directory
  3. Observe that python-dotenv is listed as a dependency
  4. (Strands only) Observe that anthropic, google-genai, and openai are all listed regardless of provider choice
  5. Search the generated .py files for any import dotenv or from dotenv — none found

Expected Behavior

  • python-dotenv should not be included since no template code imports it
  • Provider-specific SDK packages (anthropic, google-genai, openai) should only be included when the corresponding model provider is selected

Actual Behavior

  • python-dotenv is included in all 6 framework templates
  • Strands template installs all three provider SDKs unconditionally

CLI Version

0.3.0-preview.1.0

Operating System

macOS

Additional Context

The other frameworks (LangChain, CrewAI, Google ADK, OpenAI Agents, AutoGen) already use Handlebars conditionals for their provider-specific dependencies — only Strands was missing this pattern.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions