Files
Maxim 0a2a7737c7 fix(examples): declare agentcore's directly-imported deps
Several packages that agentcore code imports at module scope were never
declared in the pyproject.toml of the project that ships them. They only
resolved because something else happened to pull them in, so the next
`uv lock` that drops the intermediate would silently remove them.

That is newly dangerous: both agent Dockerfiles now install with
`uv sync --locked`, so the installed set is exactly the lockfile rather
than whatever pip incidentally resolved. A dropped transitive would turn
into an ImportError at container start instead of a quiet near-miss.

Undeclared but directly imported:

- boto3 — `agents/utils/ssm.py:12`. `agents/utils/` is COPY'd into BOTH
  agent images, so both agent projects need it; neither declared it.
- PyJWT — `agents/utils/auth.py:11`. strands declared it, langgraph did
  not and resolved it transitively only. langgraph now matches strands
  (`PyJWT[crypto]>=2.10.1`) since it is the same shared module.
- langchain-core — `tools/todos.py:10` imports `langchain_core.messages`
  in the langgraph agent; it rode in on `langchain`.
- botocore — `scripts/utils.py:17` imports `botocore.exceptions`; the
  example-root project declared boto3 but not botocore.

Floors are set at or below what the existing lockfiles already resolve,
so nothing is bumped. The lock diffs are additive metadata only: zero
resolved versions changed and no new packages entered any lock.

Deliberately not declared: `docker/resolve-env.py` (boto3, PyYAML) is
already covered by the root project; `infra-cdk/lambdas/oauth2-provider/`
uses boto3 from the Lambda runtime and is bundled by CDK, not by any of
these three uv projects.

Verification (run, not read):

  $ docker build --platform linux/arm64 \
      -f agents/langgraph-single-agent/Dockerfile -t acuv-lg-a2:test .
  naming to docker.io/library/acuv-lg-a2:test done
  $ docker build --platform linux/arm64 \
      -f agents/strands-single-agent/Dockerfile -t acuv-st-a2:test .
  naming to docker.io/library/acuv-st-a2:test done

  $ docker run --rm --platform linux/arm64 \
      -e GATEWAY_CREDENTIAL_PROVIDER_NAME=dummy -e AWS_DEFAULT_REGION=us-east-1 \
      acuv-lg-a2:test sh -c 'python -c "import langgraph_agent, boto3, jwt, langchain_core, utils.ssm, utils.auth, tools; ..."'
  OK lg 1.43.78 2.13.0 1.6.0
  $ docker run --rm --platform linux/arm64 ... acuv-st-a2:test \
      sh -c 'python -c "import strands_agent, boto3, jwt, utils.ssm, utils.auth, tools; ..."'
  OK st 1.43.78 2.13.0

  $ uv run --locked scripts/test-agent.py --help   # exit 0, usage printed
  $ uv lock --check   # passes for all three projects (14 / 144 / 123 packages)

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-24 17:13:45 +02:00

22 lines
731 B
TOML

[project]
# Dependencies for the deployment and test helpers under `scripts/`. The agents
# under `agents/` are separate, independently locked uv projects — they are not
# workspace members, so each one ships the exact dependency set that goes into
# its container image.
name = "copilotkit-agentcore-tooling"
version = "0.1.0"
description = "Deploy and test tooling for the CopilotKit + AWS AgentCore example"
requires-python = ">=3.12"
dependencies = [
"boto3>=1.34.0",
# `scripts/utils.py` imports `botocore.exceptions.ClientError` directly, so it
# is declared rather than leaned on as a boto3 transitive.
"botocore>=1.34.0",
"requests>=2.31.0",
"PyYAML>=6.0.1",
"colorama>=0.4.6",
]
[tool.uv]
package = false