Skip to content

feat(general): add support for Python 3.12 #3304

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ body:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
validations:
required: true
- type: dropdown
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/static_typing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ body:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
validations:
required: true
- type: input
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_v2_layer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jobs:
- name: Setup python
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: "3.11"
python-version: "3.12"
cache: "pip"
- name: Resolve and install project dependencies
# CDK spawns system python when compiling stack
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/quality_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
env:
PYTHON: "${{ matrix.python-version }}"
permissions:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/quality_check_pydanticv2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
env:
PYTHON: "${{ matrix.python-version }}"
permissions:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: "3.11"
python-version: "3.12"
cache: "poetry"
- name: Install dependencies
run: make dev
Expand Down Expand Up @@ -171,7 +171,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: "3.11"
python-version: "3.12"
cache: "poetry"

- name: Build python package and wheel
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable_deploy_v2_layer_stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ jobs:
- name: Setup python
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: "3.11"
python-version: "3.12"
cache: "pip"
- name: Resolve and install project dependencies
# CDK spawns system python when compiling stack
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable_publish_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: "3.11"
python-version: "3.12"
cache: "poetry"
- name: Install dependencies
run: make dev
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
strategy:
fail-fast: false # needed so if a version fails, the others will still be able to complete and cleanup
matrix:
version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
if: ${{ github.actor != 'dependabot[bot]' && github.repository == 'aws-powertools/powertools-lambda-python' }}
steps:
- name: "Checkout"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

[![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)
[![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)
![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)
![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)

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).

Expand Down
4 changes: 2 additions & 2 deletions docs/tutorial/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ Let's clone our sample project before we add one feature at a time.
Bootstrap directly via SAM CLI:

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

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

### Project structure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Globals:
Function:
Timeout: 5
MemorySize: 256
Runtime: python3.11
Runtime: python3.12
Tracing: Active
Environment:
Variables:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Globals:
Function:
Timeout: 5
MemorySize: 256
Runtime: python3.11
Runtime: python3.12
Tracing: Active
Environment:
Variables:
Expand Down
2 changes: 1 addition & 1 deletion examples/batch_processing/sam/sqs_batch_processing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Globals:
Function:
Timeout: 5
MemorySize: 256
Runtime: python3.11
Runtime: python3.12
Tracing: Active
Environment:
Variables:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Description: Hello world event handler Lambda Function URL
Globals:
Function:
Timeout: 5
Runtime: python3.11
Runtime: python3.12
Tracing: Active
Environment:
Variables:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Globals:

Function:
Timeout: 5
Runtime: python3.11
Runtime: python3.12

Resources:
# Lambda Function Solely For /users endpoint
Expand Down
2 changes: 1 addition & 1 deletion examples/event_handler_rest/sam/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Globals:

Function:
Timeout: 5
Runtime: python3.11
Runtime: python3.12
Tracing: Active
Environment:
Variables:
Expand Down
2 changes: 1 addition & 1 deletion examples/idempotency/templates/sam.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Resources:
HelloWorldFunction:
Type: AWS::Serverless::Function
Properties:
Runtime: python3.11
Runtime: python3.12
Handler: app.py
Policies:
- Statement:
Expand Down
2 changes: 1 addition & 1 deletion examples/idempotency/templates/terraform.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ resource "aws_dynamodb_table" "IdempotencyTable" {
resource "aws_lambda_function" "IdempotencyFunction" {
function_name = "IdempotencyFunction"
role = aws_iam_role.IdempotencyFunctionRole.arn
runtime = "python3.11"
runtime = "python3.12"
handler = "app.lambda_handler"
filename = "lambda.zip"

Expand Down
2 changes: 1 addition & 1 deletion examples/logger/sam/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Description: Powertools for AWS Lambda (Python) version
Globals:
Function:
Timeout: 5
Runtime: python3.11
Runtime: python3.12
Tracing: Active
Environment:
Variables:
Expand Down
2 changes: 1 addition & 1 deletion examples/metrics/sam/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Description: Powertools for AWS Lambda (Python) version
Globals:
Function:
Timeout: 5
Runtime: python3.11
Runtime: python3.12
Tracing: Active
Environment:
Variables:
Expand Down
2 changes: 1 addition & 1 deletion examples/metrics_datadog/sam/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Description: Powertools for AWS Lambda (Python) version
Globals:
Function:
Timeout: 5
Runtime: python3.11
Runtime: python3.12
Tracing: Active
Environment:
Variables:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Description: Middleware-powertools-utilities example
Globals:
Function:
Timeout: 5
Runtime: python3.9
Runtime: python3.12
Tracing: Active
Architectures:
- x86_64
Expand Down
2 changes: 1 addition & 1 deletion examples/tracer/sam/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Description: Powertools for AWS Lambda (Python) version
Globals:
Function:
Timeout: 5
Runtime: python3.11
Runtime: python3.12
Tracing: Active
Environment:
Variables:
Expand Down
Loading