Skip to content

Commit 6117772

Browse files
chore: support python 3.13 (#544)
1 parent 7fd33d4 commit 6117772

18 files changed

+3646
-310
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
strategy:
4242
max-parallel: 4
4343
matrix:
44-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
44+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
4545

4646
steps:
4747
- name: Checkout

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ We love pull requests. For new features, consider opening an issue to discuss th
2424
./scripts/build_layers.sh
2525
2626
# Publish the a testing layer to your own AWS account, and the ARN will be returned
27-
# Example: VERSION=1 REGIONS=us-east-1 LAYERS=Datadog-Python312 ./scripts/publish_layers.sh
27+
# Example: VERSION=1 REGIONS=us-east-1 LAYERS=Datadog-Python313 ./scripts/publish_layers.sh
2828
VERSION=<VERSION> REGIONS=<REGION> LAYERS=<LAYER> ./scripts/publish_layers.sh
2929
```
3030

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ RUN rm -rf ./python/lib/$runtime/site-packages/setuptools
2323
RUN rm -rf ./python/lib/$runtime/site-packages/jsonschema/tests
2424
RUN find . -name 'libddwaf.so' -delete
2525
# Comment this line out for now since ddtrace now tries to import it
26-
#RUN rm ./python/lib/$runtime/site-packages/ddtrace/appsec/_iast/_taint_tracking/*.so
27-
RUN rm ./python/lib/$runtime/site-packages/ddtrace/appsec/_iast/_stacktrace*.so
26+
# RUN rm ./python/lib/$runtime/site-packages/ddtrace/appsec/_iast/_stacktrace*.so
2827
RUN rm ./python/lib/$runtime/site-packages/ddtrace/internal/datadog/profiling/libdd_wrapper*.so
2928
RUN rm ./python/lib/$runtime/site-packages/ddtrace/internal/datadog/profiling/ddup/_ddup.*.so
30-
RUN rm ./python/lib/$runtime/site-packages/ddtrace/internal/datadog/profiling/stack_v2/_stack_v2.*.so
29+
# _stack_v2 may not exist for some versions of ddtrace (e.g. under python 3.13)
30+
RUN rm -f ./python/lib/$runtime/site-packages/ddtrace/internal/datadog/profiling/stack_v2/_stack_v2.*.so
3131
# remove *.dist-info directories except any entry_points.txt files
3232
RUN find ./python/lib/$runtime/site-packages/*.dist-info -not -name "entry_points.txt" -type f -delete
3333
RUN find ./python/lib/$runtime/site-packages -type d -empty -delete

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[![Slack](https://chat.datadoghq.com/badge.svg?bg=632CA6)](https://chat.datadoghq.com/)
77
[![License](https://img.shields.io/badge/license-Apache--2.0-blue)](https://github.com/DataDog/datadog-lambda-python/blob/main/LICENSE)
88

9-
Datadog Lambda Library for Python (3.8, 3.9, 3.10, 3.11, and 3.12) enables [enhanced Lambda metrics](https://docs.datadoghq.com/serverless/enhanced_lambda_metrics), [distributed tracing](https://docs.datadoghq.com/serverless/distributed_tracing), and [custom metric submission](https://docs.datadoghq.com/serverless/custom_metrics) from AWS Lambda functions.
9+
Datadog Lambda Library for Python (3.8, 3.9, 3.10, 3.11, 3.12, and 3.13) enables [enhanced Lambda metrics](https://docs.datadoghq.com/serverless/enhanced_lambda_metrics), [distributed tracing](https://docs.datadoghq.com/serverless/distributed_tracing), and [custom metric submission](https://docs.datadoghq.com/serverless/custom_metrics) from AWS Lambda functions.
1010

1111
## Installation
1212

ci/datasources/runtimes.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,11 @@ runtimes:
3939
python_version: "3.12"
4040
arch: "arm64"
4141
image: "3.12.0"
42+
- name: "python313"
43+
python_version: "3.13"
44+
arch: "amd64"
45+
image: "3.13.0"
46+
- name: "python313"
47+
python_version: "3.13"
48+
arch: "arm64"
49+
image: "3.13.0"

ci/publish_layers.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ AWS_CLI_PYTHON_VERSIONS=(
2121
"python3.11"
2222
"python3.12"
2323
"python3.12"
24+
"python3.13"
25+
"python3.13"
2426
)
25-
PYTHON_VERSIONS=("3.8-amd64" "3.8-arm64" "3.9-amd64" "3.9-arm64" "3.10-amd64" "3.10-arm64" "3.11-amd64" "3.11-arm64" "3.12-amd64" "3.12-arm64")
27+
PYTHON_VERSIONS=("3.8-amd64" "3.8-arm64" "3.9-amd64" "3.9-arm64" "3.10-amd64" "3.10-arm64" "3.11-amd64" "3.11-arm64" "3.12-amd64" "3.12-arm64" "3.13-amd64" "3.13-arm64")
2628
LAYER_PATHS=(
2729
".layers/datadog_lambda_py-amd64-3.8.zip"
2830
".layers/datadog_lambda_py-arm64-3.8.zip"
@@ -34,6 +36,8 @@ LAYER_PATHS=(
3436
".layers/datadog_lambda_py-arm64-3.11.zip"
3537
".layers/datadog_lambda_py-amd64-3.12.zip"
3638
".layers/datadog_lambda_py-arm64-3.12.zip"
39+
".layers/datadog_lambda_py-amd64-3.13.zip"
40+
".layers/datadog_lambda_py-arm64-3.13.zip"
3741
)
3842
LAYERS=(
3943
"Datadog-Python38"
@@ -46,6 +50,8 @@ LAYERS=(
4650
"Datadog-Python311-ARM"
4751
"Datadog-Python312"
4852
"Datadog-Python312-ARM"
53+
"Datadog-Python313"
54+
"Datadog-Python313-ARM"
4955
)
5056
STAGES=('prod', 'sandbox', 'staging')
5157

poetry.lock

Lines changed: 344 additions & 297 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@ classifiers = [
2121
"Programming Language :: Python :: 3.10",
2222
"Programming Language :: Python :: 3.11",
2323
"Programming Language :: Python :: 3.12",
24+
"Programming Language :: Python :: 3.13",
2425
]
2526

2627
[tool.poetry.dependencies]
2728
python = ">=3.8.0,<4"
2829
datadog = ">=0.51.0,<1.0.0"
2930
wrapt = "^1.11.2"
30-
ddtrace = ">=2.17.0"
31+
ddtrace = ">=2.20.0"
3132
ujson = ">=5.9.0"
3233
boto3 = { version = "^1.34.0", optional = true }
3334
requests = { version ="^2.22.0", optional = true }

scripts/add_new_region.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ LAYER_NAMES=(
2323
"Datadog-Python311-ARM"
2424
"Datadog-Python312"
2525
"Datadog-Python312-ARM"
26+
"Datadog-Python313"
27+
"Datadog-Python313-ARM"
2628
)
2729
PYTHON_VERSIONS_FOR_AWS_CLI=(
2830
"python3.8"
@@ -35,6 +37,8 @@ PYTHON_VERSIONS_FOR_AWS_CLI=(
3537
"python3.11"
3638
"python3.12"
3739
"python3.12"
40+
"python3.13"
41+
"python3.13"
3842
)
3943
NEW_REGION=$1
4044

scripts/build_layers.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ set -e
1414

1515
LAYER_DIR=".layers"
1616
LAYER_FILES_PREFIX="datadog_lambda_py"
17-
AVAILABLE_PYTHON_VERSIONS=("3.8" "3.9" "3.10" "3.11" "3.12")
17+
AVAILABLE_PYTHON_VERSIONS=("3.8" "3.9" "3.10" "3.11" "3.12" "3.13")
1818
AVAILABLE_ARCHS=("arm64" "amd64")
1919

2020
if [ -z "$ARCH" ]; then
@@ -61,7 +61,7 @@ function docker_build_zip {
6161
# between different python runtimes.
6262
temp_dir=$(mktemp -d)
6363
docker buildx build -t datadog-lambda-python-${arch}:$1 . --no-cache \
64-
--build-arg image=python:$1 \
64+
--build-arg image=public.ecr.aws/docker/library/python:$1 \
6565
--build-arg runtime=python$1 \
6666
--platform linux/${arch} \
6767
--progress=plain \

0 commit comments

Comments
 (0)