Skip to content

feat: move the Python examples and their live tests to Python 3.15 - #847

Merged
czubocha merged 3 commits into
v4from
feat/python-3-15
Nov 26, 2026
Merged

czubocha merged 3 commits into
v4from
feat/python-3-15

Conversation

@czubocha

Copy link
Copy Markdown
Contributor

Summary

Moves the Python examples, and the Python that the ci and sweep live-test jobs install, to Python 3.15.

  • .github/workflows/ci.yml and .github/workflows/sweep.yml: actions/setup-python (v7.1.0) installs python-version: '3.15'. A Python example packages with the interpreter its runtime names, so a python3.15 example needs python3.15 on the runner. The actions/python-versions manifest that setup-python reads lists 3.15.2 as stable for Linux x64 and arm64 on Ubuntu 22.04, 24.04 and 26.04.

  • Runtime python3.15 (from python3.14, or python3.13 in aws-python-line-echo-bot) in 18 examples: aws-multiple-runtime, aws-python, aws-python-alexa-skill, aws-python-auth0-custom-authorizers-api, aws-python-flask-api, aws-python-http-api, aws-python-http-api-with-dynamodb, aws-python-http-api-with-pynamodb, aws-python-line-echo-bot, aws-python-pynamodb-s3-sigurl, aws-python-rest-api, aws-python-rest-api-with-dynamodb, aws-python-rest-api-with-pymongo, aws-python-rest-api-with-pynamodb, aws-python-scheduled-cron, aws-python-simple-http-endpoint, aws-python-sqs-worker, aws-python-telegram-bot. README text and output that name the version follow.

  • aws-bedrock-agentcore/python/strands-browser: agent image python:3.15-slim and requires-python = ">=3.15".

  • Arm64 examples with compiled dependencies get the pipCmdExtraArgs of aws-python-flask-dynamodb-api, so pip downloads Linux arm64 wheels for Python 3.15 on any machine: aws-python-flask-api (MarkupSafe), aws-python-line-echo-bot (pydantic-core, aiohttp), aws-python-rest-api-with-pymongo (pymongo) and aws-python-auth0-custom-authorizers-api (cryptography, cffi; it had --platform manylinux2014_aarch64 without the Python version):

    pipCmdExtraArgs:
      - '--platform=manylinux2014_aarch64'
      - '--platform=manylinux_2_28_aarch64'
      - '--python-version=3.15'
      - '--only-binary=:all:'

    aws-python-line-echo-bot drops its python3.13 pin (pydantic-core ships cp315 aarch64 wheels) and useUv: false (packaging uses uv only when the service has a uv.lock), and its packaging note now describes these arguments.

Dependencies

  • Every requirements.txt resolves on CPython 3.15 for aarch64 with binary wheels only (uv pip compile --python-version 3.15 --python-platform aarch64-manylinux_2_28 --only-binary :all:, releases older than three days), at the current releases, so no Python pin changes: Flask 3.1.3, MarkupSafe 3.0.4, cryptography 50.0.2, PyJWT 2.15.1, pynamodb 6.1.0, pymongo 4.20.1, line-bot-sdk 3.27.0 with pydantic-core 2.50.5, python-telegram-bot 22.8.
  • npm: serverless-offline ^14.7.4 → ^14.8.5 (aws-python-auth0-custom-authorizers-api) and serverless-lift ^1.1.2 → ^1.38.0 (aws-python-sqs-worker), both released more than three days ago. serverless-wsgi ^3.0.4 in the onboarding example aws-python-flask-api already installs the current 3.1.0 and stays as it is.
  • npm audit (dev dependencies included): 0 vulnerabilities in each example with a package.json that has dependencies.

Onboarding examples

aws-python, aws-python-http-api, aws-python-flask-api and aws-python-scheduled-cron change serverless.yml (runtime; for aws-python-flask-api also pipCmdExtraArgs) and README.md (Python version, the deploy output's package size from this run). No other files change in them.

Left on Python 3.14

  • The eight LangGraph examples in aws-bedrock-agentcore/python (langgraph-basic-docker, langgraph-browser, langgraph-browser-custom, langgraph-code-interpreter, langgraph-code-interpreter-custom, langgraph-gateway, langgraph-memory, langgraph-multi-gateway): their agent images install langchain-core, which needs langsmith and so zstandard. zstandard 0.25.0, its latest release, has no CPython 3.15 wheel, and python:3.15-slim has no compiler to build its sdist (pip install . in python:3.15-slim: Failed to build 'zstandard'). The two gateway examples also need mcp-proxy-for-aws, whose releases all declare Requires-Python <3.15. They move once those packages publish 3.15 builds.
  • aws-python-flask-dynamodb-api moves to python3.15 in fix(aws-python-flask-dynamodb-api): use python3.15, keep local environments out of the package and package arm64 wheels #844.
  • aws-dev-mode is already on python3.15; aws-python-gpu-managed-instances takes its Python from the AWS deep-learning container base image.

Test plan

  • npm test (323 pass), npm run validate (25 examples, 0 errors), npm run docs and npm run check-docs (no diff).

  • serverless package (CLI 4.47.0) of all 18 examples: every function in the template has Runtime: python3.15 and arm64. The native libraries in the zips are all ARM aarch64 and built for CPython 3.15:

    Example .so files
    aws-python-flask-api 1 (markupsafe/_speedups.cpython-315-aarch64-linux-gnu.so)
    aws-python-auth0-custom-authorizers-api 2 (cryptography/hazmat/bindings/_rust.abi3t.so, _cffi_backend.cpython-315-aarch64-linux-gnu.so)
    aws-python-line-echo-bot 12 (pydantic-core, aiohttp, multidict, yarl, propcache, wrapt, charset-normalizer)
    aws-python-rest-api-with-pymongo 2 (bson/_cbson, pymongo/_cmessage)
    the other 14 none
  • Live tests, node scripts/test-example.mjs <dir>, CLI 4.47.0, us-east-1:

    PASS aws-python 4.47.0 79s
    PASS aws-python-http-api 4.47.0 85s
    PASS aws-python-flask-api 4.47.0 89s
    PASS aws-python-scheduled-cron 4.47.0 180s
    

    The functions' logs start with INIT_START Runtime Version: python:3.15.mainline.v75.

  • Deployed, exercised and removed (examples without a live test):

    Example What ran on python3.15
    aws-multiple-runtime GET /greet → 200, "Hello! It is now November 26, 2026." (Python calling the Node.js /time function)
    aws-python-rest-api GET / → 200
    aws-python-simple-http-endpoint GET /time → 200
    aws-python-alexa-skill aws lambda invoke with an intent event → "Your lucky number is 3"
    aws-python-http-api-with-dynamodb create, list, get, delete a todo → 200s
    aws-python-rest-api-with-dynamodb create, list, get, delete a todo → 200s
    aws-python-http-api-with-pynamodb create (201), list, get, delete (204)
    aws-python-rest-api-with-pynamodb create (201), list, get, delete (204), in its configured region eu-central-1
    aws-python-pynamodb-s3-sigurl POST /asset returns an upload URL and GET /asset lists the asset as CREATED
    aws-python-sqs-worker POST /produce → "Message accepted!"; the worker logged Message body: {"hello":"py315"}
    aws-python-auth0-custom-authorizers-api POST /api/public → 200; POST /api/private without a token → 401 from the authorizer (needs an Auth0 tenant for more)
    aws-python-line-echo-bot POST /webhook with a wrong X-Line-Signature → 400 Invalid signature, so line-bot-sdk and pydantic-core load (needs a LINE channel for more)
    aws-python-telegram-bot POST / with a stub update → python-telegram-bot loads and parses it, then the handler stops on the stub's missing message (needs a Telegram bot token for more)
    aws-python-rest-api-with-pymongo GET /item → pymongo loads and stops on the empty MONGO_DB_URL with InvalidURI (needs a MongoDB cluster for more)
  • strands-browser: pip install . in python:3.15-slim (amd64) installs every dependency, and uv pip compile resolves them for aarch64 with wheels only. Not deployed: its agent image is built for arm64 and needs a Bedrock AgentCore browser.

  • Afterwards no stack, log group or bucket from these runs is left in us-east-1 or eu-central-1.

Merge order

  1. This pull request, so v4 installs Python 3.15 in the live-test jobs.
  2. fix(aws-python-flask-dynamodb-api): use python3.15, keep local environments out of the package and package arm64 wheels #844 merges v4 and re-runs its live test.

Generated by Claude Code

@czubocha
czubocha merged commit 327ea3a into v4 Nov 26, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant