Skip to content

Commit f7f0d45

Browse files
Adding support for Python 3.12
1 parent 45e6555 commit f7f0d45

15 files changed

+22
-15
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ body:
6363
- "3.9"
6464
- "3.10"
6565
- "3.11"
66+
- "3.12"
6667
validations:
6768
required: true
6869
- type: dropdown

.github/ISSUE_TEMPLATE/static_typing.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ body:
3030
- "3.9"
3131
- "3.10"
3232
- "3.11"
33+
- "3.12"
3334
validations:
3435
required: true
3536
- type: input

.github/workflows/publish_v2_layer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ jobs:
107107
- name: Setup python
108108
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
109109
with:
110-
python-version: "3.11"
110+
python-version: "3.12"
111111
cache: "pip"
112112
- name: Resolve and install project dependencies
113113
# CDK spawns system python when compiling stack

.github/workflows/quality_check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
strategy:
4545
max-parallel: 4
4646
matrix:
47-
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
47+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
4848
env:
4949
PYTHON: "${{ matrix.python-version }}"
5050
permissions:

.github/workflows/quality_check_pydanticv2.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
strategy:
4545
max-parallel: 4
4646
matrix:
47-
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
47+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
4848
env:
4949
PYTHON: "${{ matrix.python-version }}"
5050
permissions:

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ jobs:
133133
- name: Set up Python
134134
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
135135
with:
136-
python-version: "3.11"
136+
python-version: "3.12"
137137
cache: "poetry"
138138
- name: Install dependencies
139139
run: make dev
@@ -171,7 +171,7 @@ jobs:
171171
- name: Set up Python
172172
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
173173
with:
174-
python-version: "3.11"
174+
python-version: "3.12"
175175
cache: "poetry"
176176

177177
- name: Build python package and wheel

.github/workflows/reusable_deploy_v2_layer_stack.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ jobs:
162162
- name: Setup python
163163
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
164164
with:
165-
python-version: "3.11"
165+
python-version: "3.12"
166166
cache: "pip"
167167
- name: Resolve and install project dependencies
168168
# CDK spawns system python when compiling stack

.github/workflows/reusable_publish_docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
- name: Set up Python
5454
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
5555
with:
56-
python-version: "3.11"
56+
python-version: "3.12"
5757
cache: "poetry"
5858
- name: Install dependencies
5959
run: make dev

.github/workflows/run-e2e-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
strategy:
4848
fail-fast: false # needed so if a version fails, the others will still be able to complete and cleanup
4949
matrix:
50-
version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
50+
version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
5151
if: ${{ github.actor != 'dependabot[bot]' && github.repository == 'aws-powertools/powertools-lambda-python' }}
5252
steps:
5353
- name: "Checkout"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
[![Build](https://github.com/aws-powertools/powertools-lambda-python/actions/workflows/quality_check.yml/badge.svg)](https://github.com/aws-powertools/powertools-lambda-python/actions/workflows/python_build.yml)
55
[![codecov.io](https://codecov.io/github/aws-powertools/powertools-lambda-python/branch/develop/graphs/badge.svg)](https://app.codecov.io/gh/aws-powertools/powertools-lambda-python)
6-
![PythonSupport](https://img.shields.io/static/v1?label=python&message=%203.7|%203.8|%203.9|%203.10|%203.11&color=blue?style=flat-square&logo=python) ![PyPI version](https://badge.fury.io/py/aws-lambda-powertools.svg) ![PyPi monthly downloads](https://img.shields.io/pypi/dm/aws-lambda-powertools) [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/aws-powertools/powertools-lambda-python/badge)](https://api.securityscorecards.dev/projects/github.com/aws-powertools/powertools-lambda-python) [![Join our Discord](https://dcbadge.vercel.app/api/server/B8zZKbbyET)](https://discord.gg/B8zZKbbyET)
6+
![PythonSupport](https://img.shields.io/static/v1?label=python&message=%203.7|%203.8|%203.9|%203.10|%203.11|%203.12&color=blue?style=flat-square&logo=python) ![PyPI version](https://badge.fury.io/py/aws-lambda-powertools.svg) ![PyPi monthly downloads](https://img.shields.io/pypi/dm/aws-lambda-powertools) [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/aws-powertools/powertools-lambda-python/badge)](https://api.securityscorecards.dev/projects/github.com/aws-powertools/powertools-lambda-python) [![Join our Discord](https://dcbadge.vercel.app/api/server/B8zZKbbyET)](https://discord.gg/B8zZKbbyET)
77

88
Powertools for AWS Lambda (Python) is a developer toolkit to implement Serverless [best practices and increase developer velocity](https://docs.powertools.aws.dev/lambda/python/latest/#features).
99

docs/tutorial/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ Let's clone our sample project before we add one feature at a time.
2020
Bootstrap directly via SAM CLI:
2121

2222
```shell
23-
sam init --app-template hello-world-powertools-python --name sam-app --package-type Zip --runtime python3.11 --no-tracing
23+
sam init --app-template hello-world-powertools-python --name sam-app --package-type Zip --runtime python3.12 --no-tracing
2424
```
2525

2626
```bash title="Use SAM CLI to initialize the sample project"
27-
sam init --runtime python3.11 --dependency-manager pip --app-template hello-world --name powertools-quickstart
27+
sam init --runtime python3.12 --dependency-manager pip --app-template hello-world --name powertools-quickstart
2828
```
2929

3030
### Project structure

examples/idempotency/templates/terraform.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ resource "aws_dynamodb_table" "IdempotencyTable" {
2828
resource "aws_lambda_function" "IdempotencyFunction" {
2929
function_name = "IdempotencyFunction"
3030
role = aws_iam_role.IdempotencyFunctionRole.arn
31-
runtime = "python3.11"
31+
runtime = "python3.12"
3232
handler = "app.lambda_handler"
3333
filename = "lambda.zip"
3434

layer/sar/template.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Metadata:
1414
SourceCodeUrl: https://github.com/aws-powertools/powertools-lambda-python
1515

1616
Transform: AWS::Serverless-2016-10-31
17-
Description: AWS Lambda Layer for aws-lambda-powertools with python 3.11, 3.10, 3.9, 3.8 or 3.7
17+
Description: AWS Lambda Layer for aws-lambda-powertools with python 3.12, 3.11, 3.10, 3.9, 3.8 or 3.7
1818

1919
Resources:
2020
LambdaLayer:
@@ -24,6 +24,7 @@ Resources:
2424
LayerName: <SAR_APP_NAME>
2525
ContentUri: <LAYER_CONTENT_PATH>
2626
CompatibleRuntimes:
27+
- python3.12
2728
- python3.11
2829
- python3.10
2930
- python3.9

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ classifiers = [
1414
"Programming Language :: Python :: 3.9",
1515
"Programming Language :: Python :: 3.10",
1616
"Programming Language :: Python :: 3.11",
17+
"Programming Language :: Python :: 3.12",
1718
]
1819
repository = "https://github.com/aws-powertools/powertools-lambda-python"
1920
documentation = "https://docs.powertools.aws.dev/lambda/python/"

tests/e2e/utils/infrastructure.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,12 @@ def create_lambda_functions(
9797
self.create_lambda_functions()
9898
```
9999
100-
Creating Lambda functions and override runtime to Python 3.11
100+
Creating Lambda functions and override runtime to Python 3.12
101101
102102
```python
103103
from aws_cdk.aws_lambda import Runtime
104104
105-
self.create_lambda_functions(function_props={"runtime": Runtime.PYTHON_3_11)
105+
self.create_lambda_functions(function_props={"runtime": Runtime.PYTHON_3_12)
106106
```
107107
"""
108108
if not self._handlers_dir.exists():
@@ -119,6 +119,7 @@ def create_lambda_functions(
119119
Runtime.PYTHON_3_9,
120120
Runtime.PYTHON_3_10,
121121
Runtime.PYTHON_3_11,
122+
Runtime.PYTHON_3_12,
122123
],
123124
compatible_architectures=[architecture],
124125
code=Code.from_asset(path=layer_build),
@@ -260,6 +261,8 @@ def _determine_runtime_version(self) -> Runtime:
260261
return Runtime.PYTHON_3_10
261262
elif version.major == 3 and version.minor == 11:
262263
return Runtime.PYTHON_3_11
264+
elif version.major == 3 and version.minor == 12:
265+
return Runtime.PYTHON_3_12
263266
else:
264267
raise Exception(f"Unsupported Python version: {version}")
265268

0 commit comments

Comments
 (0)