Repository navigation
feat: move the Python examples and their live tests to Python 3.15 - #847
Merged
Merged
Conversation
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
Moves the Python examples, and the Python that the
ciandsweeplive-test jobs install, to Python 3.15..github/workflows/ci.ymland.github/workflows/sweep.yml:actions/setup-python(v7.1.0) installspython-version: '3.15'. A Python example packages with the interpreter its runtime names, so apython3.15example needspython3.15on the runner. Theactions/python-versionsmanifest 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(frompython3.14, orpython3.13inaws-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 imagepython:3.15-slimandrequires-python = ">=3.15".Arm64 examples with compiled dependencies get the
pipCmdExtraArgsofaws-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) andaws-python-auth0-custom-authorizers-api(cryptography, cffi; it had--platform manylinux2014_aarch64without the Python version):aws-python-line-echo-botdrops itspython3.13pin (pydantic-core ships cp315 aarch64 wheels) anduseUv: false(packaging uses uv only when the service has auv.lock), and its packaging note now describes these arguments.Dependencies
requirements.txtresolves on CPython 3.15 foraarch64with 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.serverless-offline^14.7.4→^14.8.5(aws-python-auth0-custom-authorizers-api) andserverless-lift^1.1.2→^1.38.0(aws-python-sqs-worker), both released more than three days ago.serverless-wsgi^3.0.4in the onboarding exampleaws-python-flask-apialready installs the current 3.1.0 and stays as it is.npm audit(dev dependencies included): 0 vulnerabilities in each example with apackage.jsonthat has dependencies.Onboarding examples
aws-python,aws-python-http-api,aws-python-flask-apiandaws-python-scheduled-cronchangeserverless.yml(runtime; foraws-python-flask-apialsopipCmdExtraArgs) andREADME.md(Python version, the deploy output's package size from this run). No other files change in them.Left on Python 3.14
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 installlangchain-core, which needslangsmithand sozstandard.zstandard0.25.0, its latest release, has no CPython 3.15 wheel, andpython:3.15-slimhas no compiler to build its sdist (pip install .inpython:3.15-slim:Failed to build 'zstandard'). The two gateway examples also needmcp-proxy-for-aws, whose releases all declareRequires-Python <3.15. They move once those packages publish 3.15 builds.aws-python-flask-dynamodb-apimoves topython3.15in fix(aws-python-flask-dynamodb-api): use python3.15, keep local environments out of the package and package arm64 wheels #844.aws-dev-modeis already onpython3.15;aws-python-gpu-managed-instancestakes 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 docsandnpm run check-docs(no diff).serverless package(CLI 4.47.0) of all 18 examples: every function in the template hasRuntime: python3.15andarm64. The native libraries in the zips are allARM aarch64and built for CPython 3.15:.sofilesaws-python-flask-apimarkupsafe/_speedups.cpython-315-aarch64-linux-gnu.so)aws-python-auth0-custom-authorizers-apicryptography/hazmat/bindings/_rust.abi3t.so,_cffi_backend.cpython-315-aarch64-linux-gnu.so)aws-python-line-echo-botaws-python-rest-api-with-pymongobson/_cbson,pymongo/_cmessage)Live tests,
node scripts/test-example.mjs <dir>, CLI 4.47.0,us-east-1:The functions' logs start with
INIT_START Runtime Version: python:3.15.mainline.v75.Deployed, exercised and removed (examples without a live test):
python3.15aws-multiple-runtimeGET /greet→ 200, "Hello! It is now November 26, 2026." (Python calling the Node.js/timefunction)aws-python-rest-apiGET /→ 200aws-python-simple-http-endpointGET /time→ 200aws-python-alexa-skillaws lambda invokewith an intent event → "Your lucky number is 3"aws-python-http-api-with-dynamodbaws-python-rest-api-with-dynamodbaws-python-http-api-with-pynamodbaws-python-rest-api-with-pynamodbeu-central-1aws-python-pynamodb-s3-sigurlPOST /assetreturns an upload URL andGET /assetlists the asset asCREATEDaws-python-sqs-workerPOST /produce→ "Message accepted!"; the worker loggedMessage body: {"hello":"py315"}aws-python-auth0-custom-authorizers-apiPOST /api/public→ 200;POST /api/privatewithout a token → 401 from the authorizer (needs an Auth0 tenant for more)aws-python-line-echo-botPOST /webhookwith a wrongX-Line-Signature→ 400Invalid signature, so line-bot-sdk and pydantic-core load (needs a LINE channel for more)aws-python-telegram-botPOST /with a stub update → python-telegram-bot loads and parses it, then the handler stops on the stub's missingmessage(needs a Telegram bot token for more)aws-python-rest-api-with-pymongoGET /item→ pymongo loads and stops on the emptyMONGO_DB_URLwithInvalidURI(needs a MongoDB cluster for more)strands-browser:pip install .inpython:3.15-slim(amd64) installs every dependency, anduv pip compileresolves them foraarch64with 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-1oreu-central-1.Merge order
v4installs Python 3.15 in the live-test jobs.v4and re-runs its live test.Generated by Claude Code