Why is this needed?
Python 3.12 official docker image is available in preview: aws/aws-lambda-base-images#110 (comment). We can start preparing to add support Python 3.12 in Powertools for AWS Lambda.
Which area does this relate to?
Other
Solution
Use this playbook to add support for Python 3.12. Thank you @rubenfonseca for this extensive work in creating these detailed steps.
Steps
1. Prerequisites
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. Bumping the supported runtimes in the layer construct
On the CDK Layer repository, 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
yarn projen test
- Submit and merge a PR with the changes
- Execute the release workflow to generate a new version of the construct from the main branch
4. Updating workflows and templates
- Update all files inside the
.github directory to include the new runtime version. This includes the e2e workflow
5. Layer
6. SAR
- Add the new runtime to the
layer/sar/template.txt
7. Change the PyPi metadata
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)
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.
- Have a cold beverage (don't forget that) and celebrate! 🍺 🎉
Acknowledgment
Why is this needed?
Python 3.12 official docker image is available in preview: aws/aws-lambda-base-images#110 (comment). We can start preparing to add support Python 3.12 in Powertools for AWS Lambda.
Which area does this relate to?
Other
Solution
Use this playbook to add support for Python 3.12. Thank you @rubenfonseca for this extensive work in creating these detailed steps.
Steps
1. Prerequisites
2. Testing locally
make pr3. Bumping the supported runtimes in the layer construct
On the CDK Layer repository, do:
yarn projen test4. Updating workflows and templates
.githubdirectory to include the new runtime version. This includes the e2e workflow5. Layer
package.jsonand runningnpm installpyproject.tomland runningpoetry lock.6. SAR
layer/sar/template.txt7. Change the PyPi metadata
pyproject.tomland update the poetry classifiers to include the new runtime.8. Open a PR and run E2E tests
9. Examples
10. Merge and release
Acknowledgment