Skip to content

fix(bma): set requires-python >=3.12 so uv run client.py does not use an older system Python - #2491

Merged
tejaskash merged 1 commit into
mainfrom
fix/bma-feedback
Sep 30, 2026
Merged

tejaskash merged 1 commit into
mainfrom
fix/bma-feedback

Conversation

@siwachabhi

Copy link
Copy Markdown
Collaborator

Description

The BedrockManagedAgents template has no requires-python in pyproject.toml. On macOS, uv run client.py can then pick the system Python 3.9, and openai does not install on it.

This PR sets requires-python = ">=3.12" in the template pyproject.toml. It is a minimum only. The Dockerfile still runs uv python install --default before it copies pyproject.toml, so the image keeps the latest Python, and uv sync checks the minimum.

Changes:

  • src/assets/python/http/bma/base/pyproject.toml: add requires-python = ">=3.12".
  • src/assets/python/http/bma/base/README.md: tell the reader why the minimum is there.
  • src/cli/templates/__tests__/bma.test.ts: check the minimum, and check that the image installs Python before it copies pyproject.toml.
  • Updated asset snapshots (2 lines).

Related Issue

No issue. The problem came from feedback on the BMA getting started guide.

Documentation PR

None.

Type of Change

  • Bug fix

Testing

  • npx vitest run --project unit src/cli/templates/__tests__/bma.test.ts src/assets/__tests__/assets.snapshot.test.ts (164 passed)
  • npm run typecheck
  • eslint and prettier on the changed files (pre-commit hook)
  • Updated the asset snapshots
  • Full npm run test:unit and npm run test:integ not run

Checklist

  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • My changes generate no new warnings

… an older system Python

Without requires-python, uv can pick the macOS system Python 3.9 for
client.py, and the openai dependency does not install on it. The image
still installs the latest Python before it copies pyproject.toml, so the
minimum does not pin the image.
@siwachabhi
siwachabhi requested a review from a team September 30, 2026 21:37
@github-actions github-actions Bot added the size/xs PR size: XS label Sep 30, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added agentcore-harness-reviewing AgentCore Harness review in progress claude-security-reviewing Claude Code /security-review in progress labels Sep 30, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Sep 30, 2026

@agentcore-devx-automation agentcore-devx-automation Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AgentCore Harness Review

Verdict: Looks good

Small, focused change that adds requires-python = ">=3.12" to the BMA pyproject.toml template so uv run client.py doesn't fall back to a system Python 3.9 (which the openai SDK no longer supports). Consistent with the other Python templates, which all set a requires-python minimum.

A few observations, none blocking:

  • The >=3.12 bound is stricter than strictly needed for the stated reason (openai SDK dropped 3.9, so >=3.10 would suffice, and matches most other templates). If there's a specific reason for 3.12 over 3.10 it might be worth noting in the README paragraph; otherwise >=3.10 would be more permissive for client environments. Not a blocker either way.
  • The updated test nicely asserts that RUN uv python install --default runs before COPY pyproject.toml so the minimum doesn't inadvertently pin the image build. Good defensive check.
  • Uses real fs reads against generated output — no excessive mocking. No telemetry needed for a template constant change.

@agentcore-devx-automation agentcore-devx-automation Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label Sep 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 41.28% 15848 / 38384
🔵 Statements 40.55% 16912 / 41697
🔵 Functions 35.37% 2730 / 7718
🔵 Branches 34.47% 10621 / 30805
Generated in workflow #4500 for commit 5efb467 by the Vitest Coverage Report Action

@tejaskash
tejaskash merged commit be16c4f into main Sep 30, 2026
41 of 43 checks passed
@tejaskash
tejaskash deleted the fix/bma-feedback branch September 30, 2026 21:45
tejaskash added a commit that referenced this pull request Sep 30, 2026
Mirrors #2491. Without a minimum, uv run client.py can pick the macOS
system Python 3.9, which openai does not support.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/xs PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants