Closed
Description
Why is this needed?
According to the official AWS documentation, the AWS Lambda Python 3.13 runtime will be released in November 2024, and considering that Python 3.13 has had some changes in this release, we need to start working to detect and fix any issues and be ready when this runtime is released.
*This date is indicative only and subject to change.
Which area does this relate to?
No response
Solution
Use this playbook to add support for Python 3.13.
Steps
1. Prerequisites
- The new AWS Lambda Python runtime needs to be supported by CDK
- The new AWS Lambda Python runtime needs to be supported by SAM
- The new Python version needs to be supported by any required dependencies
2. Testing locally
- Must install the new Python runtime version and run all the tests and linters locally to see if anything is breaking, by running
make pr
3. Adding the new supported runtime in the layer construct
On the CDK Layer constructor, do:
- Bump the CDK version to support the new AWS Lambda Python runtime version
- Change the supported runtimes to include the new runtime
- Make sure tests still pass by running
poetry run pytest tests
- Submit and merge a PR with the changes
4. Updating workflows and templates
- Update all files inside the
.github
directory to include the new runtime version. This includes the e2e workflow- Example: this example PR added support to 3.10
5. Layer
- Bump the CDK version on the on the root of the repository, by editing
package.json
and runningnpm install
- Inside the layer directory: bump the Layer construct version by editing the
pyproject.toml
and runningpoetry lock
.
6. SAR
- Add the new runtime to the
layer_v3/sar/template.txt
7. Change the PyPi metadata
- Edit the
pyproject.toml
and update the poetry classifiers to include the new runtime.
8. Open a PR and run E2E tests
- Open a new PR with the changes made in steps 4, 5, 6 and 7.
- Wait for the automated tests to pass (so the tests run against the new runtime)
- Manually schedule an E2E workflow on that branch (so the automated tests run against the new runtime)
- Example: this example PR added support to 3.10
9. Examples
- Update the SAM/Terraform examples to use the latest version of the supported runtime.
10. Merge and release
- If everything is green you should be able to merge the PR and release a new version, which will generate and publish the new Layer and SAR template.
- Celebrate and start using this new runtime! 🍺 🎉
Acknowledgment
- This request meets Powertools for AWS Lambda (Python) Tenets
- Should this be considered in other Powertools for AWS Lambda languages? i.e. Java, TypeScript, and .NET
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Shipped