Skip to content

Commit da4d0a6

Browse files
authored
Add support for Python 3.9 (#164)
1 parent 7983e78 commit da4d0a6

20 files changed

+133
-15
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- name: Set up Python
1414
uses: actions/setup-python@v2
1515
with:
16-
python-version: 3.7
16+
python-version: 3.9
1717

1818
- name: Install dependencies
1919
run: |
@@ -37,7 +37,7 @@ jobs:
3737
strategy:
3838
max-parallel: 4
3939
matrix:
40-
python-version: [2.7, 3.6, 3.7, 3.8]
40+
python-version: [2.7, 3.6, 3.7, 3.8, 3.9]
4141

4242
steps:
4343
- name: Checkout
@@ -64,7 +64,7 @@ jobs:
6464
runs-on: ubuntu-latest
6565
strategy:
6666
matrix:
67-
runtime-param: [2.7, 3.6, 3.7, 3.8]
67+
runtime-param: [2.7, 3.6, 3.7, 3.8, 3.9]
6868
steps:
6969
- name: Checkout
7070
uses: actions/checkout@v2

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 (2.7, 3.6, 3.7 and 3.8) enables enhanced Lambda metrics, distributed tracing, and custom metric submission from AWS Lambda functions.
9+
Datadog Lambda Library for Python (2.7, 3.6, 3.7, 3.8, and 3.9) enables enhanced Lambda metrics, distributed tracing, and custom metric submission from AWS Lambda functions.
1010

1111
**IMPORTANT NOTE:** AWS Lambda is expected to receive a [breaking change](https://aws.amazon.com/blogs/compute/upcoming-changes-to-the-python-sdk-in-aws-lambda/) on **December 1, 2021**. If you are using Datadog Python Lambda layer version 7 or below, please upgrade to the latest.
1212

scripts/add_new_region.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ set -e
1212

1313
OLD_REGION='us-east-1'
1414

15-
PYTHON_VERSIONS_FOR_AWS_CLI=("python2.7" "python3.6" "python3.7" "python3.8")
16-
LAYER_NAMES=("Datadog-Python27" "Datadog-Python36" "Datadog-Python37" "Datadog-Python38")
15+
PYTHON_VERSIONS_FOR_AWS_CLI=("python2.7" "python3.6" "python3.7" "python3.8" "python3.9")
16+
LAYER_NAMES=("Datadog-Python27" "Datadog-Python36" "Datadog-Python37" "Datadog-Python38" "Datadog-Python39")
1717
NEW_REGION=$1
1818

1919
publish_layer() {

scripts/build_layers.sh

Lines changed: 1 addition & 1 deletion
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=("2.7" "3.6" "3.7" "3.8")
17+
AVAILABLE_PYTHON_VERSIONS=("2.7" "3.6" "3.7" "3.8" "3.9")
1818

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

scripts/check_layer_size.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ MAX_LAYER_UNCOMPRESSED_SIZE_KB=$(expr 16 \* 1024)
1414

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

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

scripts/list_layers.sh

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

1111
set -e
1212

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

scripts/publish_layers.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ 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=("python2.7" "python3.6" "python3.7" "python3.8")
17-
LAYER_PATHS=(".layers/datadog_lambda_py2.7.zip" ".layers/datadog_lambda_py3.6.zip" ".layers/datadog_lambda_py3.7.zip" ".layers/datadog_lambda_py3.8.zip")
18-
AVAILABLE_LAYERS=("Datadog-Python27" "Datadog-Python36" "Datadog-Python37" "Datadog-Python38")
16+
PYTHON_VERSIONS_FOR_AWS_CLI=("python2.7" "python3.6" "python3.7" "python3.8" "python3.9")
17+
LAYER_PATHS=(".layers/datadog_lambda_py2.7.zip" ".layers/datadog_lambda_py3.6.zip" ".layers/datadog_lambda_py3.7.zip" ".layers/datadog_lambda_py3.8.zip" ".layers/datadog_lambda_py3.9.zip")
18+
AVAILABLE_LAYERS=("Datadog-Python27" "Datadog-Python36" "Datadog-Python37" "Datadog-Python38" "Datadog-Python39")
1919
AVAILABLE_REGIONS=$(aws ec2 describe-regions | jq -r '.[] | .[] | .RegionName')
2020

2121
# Check that the layer files exist

scripts/run_integration_tests.sh

Lines changed: 3 additions & 2 deletions
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=("python27" "python36" "python37" "python38")
14+
RUNTIMES=("python27" "python36" "python37" "python38" "python39")
1515

1616
LOGS_WAIT_SECONDS=20
1717

@@ -32,8 +32,9 @@ python27=("python2.7" "2.7" $(xxd -l 4 -c 4 -p < /dev/random))
3232
python36=("python3.6" "3.6" $(xxd -l 4 -c 4 -p < /dev/random))
3333
python37=("python3.7" "3.7" $(xxd -l 4 -c 4 -p < /dev/random))
3434
python38=("python3.8" "3.8" $(xxd -l 4 -c 4 -p < /dev/random))
35+
python39=("python3.9" "3.9" $(xxd -l 4 -c 4 -p < /dev/random))
3536

36-
PARAMETERS_SETS=("python27" "python36" "python37" "python38")
37+
PARAMETERS_SETS=("python27" "python36" "python37" "python38" "python39")
3738

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

scripts/run_tests.sh

Lines changed: 1 addition & 1 deletion
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=("2.7" "3.6" "3.7" "3.8")
11+
PYTHON_VERSIONS=("2.7" "3.6" "3.7" "3.8" "3.9")
1212

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

scripts/sign_layers.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ LAYER_FILES=(
1313
"datadog_lambda_py3.6.zip"
1414
"datadog_lambda_py3.7.zip"
1515
"datadog_lambda_py3.8.zip"
16+
"datadog_lambda_py3.9.zip"
1617
)
1718
SIGNING_PROFILE_NAME="DatadogLambdaSigningProfile"
1819

0 commit comments

Comments
 (0)