Skip to content

Commit 5951821

Browse files
duncanistaastuyvejoeyzhao2018
authored
feat: support Python 3.11 (#355)
* update scripts * update gh actions * update `pyproject.toml` * update `README.md` * add snapshots * fix: ints * fix the potential circular import --------- Co-authored-by: AJ Stuyvenberg <[email protected]> Co-authored-by: Joey Zhao <[email protected]>
1 parent 6c7851f commit 5951821

14 files changed

+3070
-16
lines changed

.github/workflows/build.yml

+2-2
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.7', '3.8', '3.9', '3.10']
44+
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
4545

4646
steps:
4747
- name: Checkout
@@ -68,7 +68,7 @@ jobs:
6868
runs-on: ubuntu-latest
6969
strategy:
7070
matrix:
71-
runtime-param: ['3.7', '3.8', '3.9', '3.10']
71+
runtime-param: ['3.7', '3.8', '3.9', '3.10', '3.11']
7272
steps:
7373
- name: Checkout
7474
uses: actions/checkout@v3

README.md

+1-1
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.7, 3.8, 3.9, and 3.10) 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.7, 3.8, 3.9, 3.10, and 3.11) 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

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ classifiers = [
2020
"Programming Language :: Python :: 3.8",
2121
"Programming Language :: Python :: 3.9",
2222
"Programming Language :: Python :: 3.10",
23+
"Programming Language :: Python :: 3.11",
2324
]
2425

2526
[tool.poetry.dependencies]

scripts/add_new_region.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ set -e
1212

1313
OLD_REGION='us-east-1'
1414

15-
LAYER_NAMES=("Datadog-Python37" "Datadog-Python38" "Datadog-Python38-ARM" "Datadog-Python39" "Datadog-Python39-ARM" "Datadog-Python310" "Datadog-Python310-ARM")
16-
PYTHON_VERSIONS_FOR_AWS_CLI=("python3.7" "python3.8" "python3.8" "python3.9" "python3.9" "python3.10" "python3.10")
15+
LAYER_NAMES=("Datadog-Python37" "Datadog-Python38" "Datadog-Python38-ARM" "Datadog-Python39" "Datadog-Python39-ARM" "Datadog-Python310" "Datadog-Python310-ARM" "Datadog-Python311" "Datadog-Python311-ARM")
16+
PYTHON_VERSIONS_FOR_AWS_CLI=("python3.7" "python3.8" "python3.8" "python3.9" "python3.9" "python3.10" "python3.10" "python3.11" "python3.11")
1717
NEW_REGION=$1
1818

1919
publish_layer() {

scripts/build_layers.sh

+1-1
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.7" "3.8" "3.9" "3.10")
17+
AVAILABLE_PYTHON_VERSIONS=("3.7" "3.8" "3.9" "3.10" "3.11")
1818

1919
# Determine which Python versions to build layers for
2020
if [ -z "$PYTHON_VERSION" ]; then

scripts/check_layer_size.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ MAX_LAYER_UNCOMPRESSED_SIZE_KB=$(expr 24 \* 1024)
1414

1515
LAYER_FILES_PREFIX="datadog_lambda_py"
1616
LAYER_DIR=".layers"
17-
VERSIONS=("3.7" "3.8" "3.9" "3.10")
17+
VERSIONS=("3.7" "3.8" "3.9" "3.10" "3.11")
1818

1919
for version in "${VERSIONS[@]}"
2020
do

scripts/list_layers.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
set -e
1212

13-
LAYER_NAMES=("Datadog-Python37" "Datadog-Python38" "Datadog-Python38-ARM" "Datadog-Python39" "Datadog-Python39-ARM" "Datadog-Python310" "Datadog-Python310-ARM")
13+
LAYER_NAMES=("Datadog-Python37" "Datadog-Python38" "Datadog-Python38-ARM" "Datadog-Python39" "Datadog-Python39-ARM" "Datadog-Python310" "Datadog-Python310-ARM" "Datadog-Python311" "Datadog-Python311-ARM")
1414
AVAILABLE_REGIONS=$(aws ec2 describe-regions | jq -r '.[] | .[] | .RegionName')
1515
LAYERS_MISSING_REGIONS=()
1616

scripts/publish_layers.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ set -e
1313
# Makes sure any subprocesses will be terminated with this process
1414
trap "pkill -P $$; exit 1;" INT
1515

16-
PYTHON_VERSIONS_FOR_AWS_CLI=("python3.7" "python3.8" "python3.8" "python3.9" "python3.9" "python3.10" "python3.10")
17-
LAYER_PATHS=(".layers/datadog_lambda_py-amd64-3.7.zip" ".layers/datadog_lambda_py-amd64-3.8.zip" ".layers/datadog_lambda_py-arm64-3.8.zip" ".layers/datadog_lambda_py-amd64-3.9.zip" ".layers/datadog_lambda_py-arm64-3.9.zip" ".layers/datadog_lambda_py-amd64-3.10.zip" ".layers/datadog_lambda_py-arm64-3.10.zip")
18-
AVAILABLE_LAYERS=("Datadog-Python37" "Datadog-Python38" "Datadog-Python38-ARM" "Datadog-Python39" "Datadog-Python39-ARM" "Datadog-Python310" "Datadog-Python310-ARM")
19-
ARCHS=("amd64" "amd64" "amd64""amd64" "amd64" "arm64" "amd64" "arm64")
16+
PYTHON_VERSIONS_FOR_AWS_CLI=("python3.7" "python3.8" "python3.8" "python3.9" "python3.9" "python3.10" "python3.10" "python3.11" "python3.11")
17+
LAYER_PATHS=(".layers/datadog_lambda_py-amd64-3.7.zip" ".layers/datadog_lambda_py-amd64-3.8.zip" ".layers/datadog_lambda_py-arm64-3.8.zip" ".layers/datadog_lambda_py-amd64-3.9.zip" ".layers/datadog_lambda_py-arm64-3.9.zip" ".layers/datadog_lambda_py-amd64-3.10.zip" ".layers/datadog_lambda_py-arm64-3.10.zip" ".layers/datadog_lambda_py-amd64-3.11.zip" ".layers/datadog_lambda_py-arm64-3.11.zip")
18+
AVAILABLE_LAYERS=("Datadog-Python37" "Datadog-Python38" "Datadog-Python38-ARM" "Datadog-Python39" "Datadog-Python39-ARM" "Datadog-Python310" "Datadog-Python310-ARM" "Datadog-Python311" "Datadog-Python311-ARM")
19+
ARCHS=("amd64" "amd64" "amd64""amd64" "amd64" "arm64" "amd64" "arm64" "amd64" "arm64")
2020
AVAILABLE_REGIONS=$(aws ec2 describe-regions | jq -r '.[] | .[] | .RegionName')
2121

2222
# Check that the layer files exist

scripts/run_integration_tests.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ set -e
1111
# These values need to be in sync with serverless.yml, where there needs to be a function
1212
# defined for every handler_runtime combination
1313
LAMBDA_HANDLERS=("async-metrics" "sync-metrics")
14-
RUNTIMES=("python37" "python38" "python39" "python310")
14+
RUNTIMES=("python37" "python38" "python39" "python310" "python311")
1515

1616
LOGS_WAIT_SECONDS=20
1717

@@ -32,8 +32,9 @@ python37=("python3.7" "3.7" $(xxd -l 4 -c 4 -p < /dev/random))
3232
python38=("python3.8" "3.8" $(xxd -l 4 -c 4 -p < /dev/random))
3333
python39=("python3.9" "3.9" $(xxd -l 4 -c 4 -p < /dev/random))
3434
python310=("python3.10" "3.10" $(xxd -l 4 -c 4 -p < /dev/random))
35+
python311=("python3.11" "3.11" $(xxd -l 4 -c 4 -p < /dev/random))
3536

36-
PARAMETERS_SETS=("python37" "python38" "python39" "python310")
37+
PARAMETERS_SETS=("python37" "python38" "python39" "python310" "python311")
3738

3839
if [ -z "$RUNTIME_PARAM" ]; then
3940
echo "Python version not specified, running for all python versions."

scripts/run_tests.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# Run unit tests in Docker
99
set -e
1010

11-
PYTHON_VERSIONS=("3.7" "3.8" "3.9" "3.10")
11+
PYTHON_VERSIONS=("3.7" "3.8" "3.9" "3.10" "3.11")
1212

1313
for python_version in "${PYTHON_VERSIONS[@]}"
1414
do

scripts/sign_layers.sh

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ LAYER_FILES=(
1616
"datadog_lambda_py-arm64-3.9.zip"
1717
"datadog_lambda_py-amd64-3.10.zip"
1818
"datadog_lambda_py-arm64-3.10.zip"
19+
"datadog_lambda_py-amd64-3.11.zip"
20+
"datadog_lambda_py-arm64-3.11.zip"
1921
)
2022
SIGNING_PROFILE_NAME="DatadogLambdaSigningProfile"
2123

0 commit comments

Comments
 (0)