Repository navigation
feat: add Python 3.15 runtime - #9398
Conversation
🧪 Hands-on test: No problems observed in 6 scenariosCommit Scenarios
Runner's notes in full
🤖 Automated hands-on test — not a review approval · model claude-opus-5.5 · Kiro kiro-cli 2.33.1 · build History (6)
|
There was a problem hiding this comment.
🧪 Hands-on test reproduced 1 new problem on commit 7949248. Commands and evidence are in the hands-on comment.
- [BUG] sam build fails for python3.15 (pip workflow): pinned aws_lambda_builders 1.68.0 does not support python3.15 · high · pyproject.toml:48
🤖 Automated hands-on test — not a review approval
There was a problem hiding this comment.
✅ Lambda Tooling PR Reviewer: No high-confidence issues found.
1 lower-confidence observation: these passed verification at a lower score, so check before acting
1. [BUG] tests/integration/buildcmd/test_build_cmd_python.py:369: New python3.15 non-container build tests run sam local invoke against an image this PR says is not released yet
The PR adds python3.15 cases with use_container=False at lines 362-369, 379-381 and 592-593, and at lines 43 and 50 of test_build_cmd_arm64.py. All of them go through BuildIntegPythonBase._test_with_default_requirements, which calls _verify_invoke_built_function whenever SKIP_DOCKER_TESTS is false. That invoke needs a python3.15 Lambda image. The same PR holds back the Dockerfile tests with the comment # add "3.15" once public.ecr.aws/lambda/python:3.15 is released, so by the PR's own statement these invoke steps will fail in Docker-enabled CI. To fix it, hold these cases back the same way, or pass a flag that skips the invoke step for 3.15 until the image is published.
There was a problem hiding this comment.
🧪 Hands-on test reproduced 1 new problem on commit 53f64bf. Commands and evidence are in the hands-on comment.
- [BUG] sam build with pip rejects python3.15: pinned aws_lambda_builders==1.68.0 does not support the runtime the PR adds · high · pyproject.toml:49
🤖 Automated hands-on test — not a review approval
reedham-aws
left a comment
There was a problem hiding this comment.
The changes mostly look good. I think we'll have to wait for lambda-builders release for the tests to start passing (at least some of the tests).
| try: | ||
| # commonpath compares whole path components; commonprefix compares characters, | ||
| # which would wrongly treat "/tmp/ab/x" as being inside "/tmp/a". | ||
| return os.path.commonpath([abs_directory, abs_target]) == abs_directory | ||
| except ValueError: | ||
| # Raised for paths on different drives (Windows): they cannot be nested | ||
| return False |
There was a problem hiding this comment.
I don't follow why this is being changed here. The same change is in aws/aws-lambda-builders#950, and there I commented that the original comment is confusing because commonprefix isn't used anymore, so it doesn't make sense to mention it in the comment.
There was a problem hiding this comment.
The reason is os.path.commonprefix() is deprecated in Python3.15. Yeah this PR also makes sam-cli itself Python3.15 compatible, which I think is ok. I am not sure if this code reachable or not, but it must failed some thing that AI made the change.
| # Note that returning within a finally block will have the effect of swallowing | ||
| # any reraised exceptions. | ||
| return auth_service_error | ||
| if auth_service_error: |
There was a problem hiding this comment.
I also don't see why we're changing the comment here for what seems unrelated. The Python 3.15 update is not for the Python interpreter that runs this code in SAM CLI, but the interpreter that is used for user code. This means that the Python 3.15 update shouldn't affect this code at all. I could be wrong or misunderstanding something about this, so just let me know.
There was a problem hiding this comment.
Yeah this PR includes changes to make sam-cli run in Python3.15. The change here was because some error / warning I remember, which said return should not be inside finally block.
There was a problem hiding this comment.
🧪 Hands-on test reproduced 1 new problem on commit 87e21a5. Commands and evidence are in the hands-on comment.
- [BUG] sam build fails for python3.15 with the pip workflow: pinned aws_lambda_builders 1.68.0 does not support python3.15 · high · pyproject.toml:49
🤖 Automated hands-on test — not a review approval
reedham-aws
left a comment
There was a problem hiding this comment.
| "regex!=2021.10.8", | ||
| "tzlocal==5.4.4", | ||
| # Bounded to the versions that lint every SAM resource type, see #9249 | ||
| "cfn-lint>=1.52.0,<1.59", |
There was a problem hiding this comment.
Sorry I didn't leave this comment earlier, but what is the reason for bumping this here?
There was a problem hiding this comment.
Because cfn-lint 1.59 starts to support Python3.15
So I can remove the sam-cli 3.15 support but only keep the runtime 3.15 support. Will that be ok? |
There was a problem hiding this comment.
✅ Lambda Tooling PR Reviewer: No high-confidence issues found.
1 lower-confidence observation: these passed verification at a lower score, so check before acting
1. [BUG] tests/integration/buildcmd/test_build_cmd_python.py:369: New python3.15 build rows still run sam local invoke against a Lambda image the PR itself describes as unreleased
BuildIntegPythonBase._test_with_default_requirements calls _verify_invoke_built_function whenever SKIP_DOCKER_TESTS is false, even with use_container=False. The invoke pulls public.ecr.aws/lambda/python:3.15-<arch>. The PR leaves 3.15 out of the image-based tests with the comment "add "3.15" once public.ecr.aws/lambda/python:3.15 is released". It still adds 3.15 rows that invoke: the non-container al2023 rows here, the architecture rows at lines 592-593, and the arm64 rows in test_build_cmd_arm64.py lines 43 and 50. Before merging, check whether that image is published. If it isn't, comment these rows out like the other 3.15 rows. If it is, the "once ... is released" comments are out of date.
There was a problem hiding this comment.
🧪 Hands-on test reproduced 1 new problem on commit 8a3c75b. Commands and evidence are in the hands-on comment.
- [BUG] sam build for python3.15 fails: pinned aws-lambda-builders 1.68.0 rejects 'Runtime python3.15 is not supported' · high · pyproject.toml:48
🤖 Automated hands-on test — not a review approval
Which issue(s) does this change fix?
Why is this change necessary?
To add python3.13 runtime support
How does it address the issue?
What side effects does this change have?
Mandatory Checklist
PRs will only be reviewed after checklist is complete
make prpassesmake update-reproducible-reqsif dependencies were changedBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.