Skip to content

Commit 8d38aa9

Browse files
authored
feat: Drop py3.7 (#395)
* feat: Drop py3.7 from build script as we stopped publishing it a while ago * feat: more drops * feat: Remove python 3.7 * feat: Remove more 3.7 refs * feat: More 3.7 refs dropped * Feat: Mention deprecation in readme. Remove 3.7 from contributing.md * feat: Remove version_info
1 parent 5d90a9a commit 8d38aa9

17 files changed

+24
-3200
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
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', '3.11', '3.12']
44+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
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', '3.11', '3.12']
71+
runtime-param: ['3.8', '3.9', '3.10', '3.11', '3.12']
7272
steps:
7373
- name: Checkout
7474
uses: actions/checkout@v3

.github/workflows/check-size.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- name: Set up Python
1313
uses: actions/setup-python@v4
1414
with:
15-
python-version: 3.7
15+
python-version: 3.12
1616

1717
- name: Install Crossbuild Deps
1818
run: |

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-Python37 ./scripts/publish_layers.sh
27+
# Example: VERSION=1 REGIONS=us-east-1 LAYERS=Datadog-Python312 ./scripts/publish_layers.sh
2828
VERSION=<VERSION> REGIONS=<REGION> LAYERS=<LAYER> ./scripts/publish_layers.sh
2929
```
3030

README.md

Lines changed: 4 additions & 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.7, 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, 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.
1010

1111
## Installation
1212

@@ -47,6 +47,9 @@ The Continuous Profiler works by spawning a thread which periodically wakes up a
4747

4848
## Major Version Notes
4949

50+
### 5.x / Layer version 86+
51+
- Python3.7 support has been [deprecated](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) by AWS, and support removed from this library.
52+
5053
### 4.x / Layer version 61+
5154

5255
- Python3.6 support has been [deprecated](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) by AWS, and support removed from this library.

datadog_lambda/cold_start.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,13 @@ def initialize_cold_start_tracing():
144144
and os.environ.get("DD_TRACE_ENABLED", "true").lower() == "true"
145145
and os.environ.get("DD_COLD_START_TRACING", "true").lower() == "true"
146146
):
147-
from sys import version_info, meta_path
147+
from sys import meta_path
148148

149-
if version_info >= (3, 7): # current implementation only support version > 3.7
150-
for importer in meta_path:
151-
try:
152-
importer.find_spec = wrap_find_spec(importer.find_spec)
153-
except Exception:
154-
pass
149+
for importer in meta_path:
150+
try:
151+
importer.find_spec = wrap_find_spec(importer.find_spec)
152+
except Exception:
153+
pass
155154

156155

157156
class ColdStartTracer(object):

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ packages = [
1616
{ include = "datadog_lambda" }
1717
]
1818
classifiers = [
19-
"Programming Language :: Python :: 3.7",
2019
"Programming Language :: Python :: 3.8",
2120
"Programming Language :: Python :: 3.9",
2221
"Programming Language :: Python :: 3.10",
@@ -25,7 +24,7 @@ classifiers = [
2524
]
2625

2726
[tool.poetry.dependencies]
28-
python = ">=3.7.0,<4"
27+
python = ">=3.8.0,<4"
2928
datadog = ">=0.41.0,<1.0.0"
3029
wrapt = "^1.11.2"
3130
ddtrace = ">=2.3.1"

scripts/add_new_region.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ set -e
1313
OLD_REGION='us-east-1'
1414

1515
LAYER_NAMES=(
16-
"Datadog-Python37"
1716
"Datadog-Python38"
1817
"Datadog-Python38-ARM"
1918
"Datadog-Python39"
@@ -26,7 +25,6 @@ LAYER_NAMES=(
2625
"Datadog-Python312-ARM"
2726
)
2827
PYTHON_VERSIONS_FOR_AWS_CLI=(
29-
"python3.7"
3028
"python3.8"
3129
"python3.8"
3230
"python3.9"

scripts/build_layers.sh

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77

88
# Builds datadog-lambda-python layers for Lambda functions
99

10-
# Usage: PYTHON_VERSION=3.7 ./build_layers.sh
10+
# Usage: PYTHON_VERSION=3.11 ./build_layers.sh
1111
# If PYTHON_VERSION is not specified, all versions will be built.
1212

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

1919
# Determine which Python versions to build layers for
2020
if [ -z "$PYTHON_VERSION" ]; then
@@ -68,10 +68,8 @@ mkdir $LAYER_DIR
6868

6969
for python_version in "${PYTHON_VERSIONS[@]}"
7070
do
71-
if [ "$python_version" != "3.7" ]; then
72-
echo "Building layer for Python ${python_version} arch=arm64"
73-
docker_build_zip ${python_version} $LAYER_DIR/${LAYER_FILES_PREFIX}-arm64-${python_version}.zip arm64
74-
fi
71+
echo "Building layer for Python ${python_version} arch=arm64"
72+
docker_build_zip ${python_version} $LAYER_DIR/${LAYER_FILES_PREFIX}-arm64-${python_version}.zip arm64
7573
echo "Building layer for Python ${python_version} arch=amd64"
7674
docker_build_zip ${python_version} $LAYER_DIR/${LAYER_FILES_PREFIX}-amd64-${python_version}.zip amd64
7775
done

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 24 \* 1024)
1414

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

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

scripts/list_layers.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
set -e
1212

1313
LAYER_NAMES=(
14-
"Datadog-Python37"
1514
"Datadog-Python38"
1615
"Datadog-Python38-ARM"
1716
"Datadog-Python39"

scripts/publish_layers.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ set -e
1414
trap "pkill -P $$; exit 1;" INT
1515

1616
PYTHON_VERSIONS_FOR_AWS_CLI=(
17-
"python3.7"
1817
"python3.8"
1918
"python3.8"
2019
"python3.9"
@@ -27,7 +26,6 @@ PYTHON_VERSIONS_FOR_AWS_CLI=(
2726
"python3.12"
2827
)
2928
LAYER_PATHS=(
30-
".layers/datadog_lambda_py-amd64-3.7.zip"
3129
".layers/datadog_lambda_py-amd64-3.8.zip"
3230
".layers/datadog_lambda_py-arm64-3.8.zip"
3331
".layers/datadog_lambda_py-amd64-3.9.zip"
@@ -40,7 +38,6 @@ LAYER_PATHS=(
4038
".layers/datadog_lambda_py-arm64-3.12.zip"
4139
)
4240
AVAILABLE_LAYERS=(
43-
"Datadog-Python37"
4441
"Datadog-Python38"
4542
"Datadog-Python38-ARM"
4643
"Datadog-Python39"

scripts/run_integration_tests.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,13 @@ mismatch_found=false
2727
# [0]: serverless runtime name
2828
# [1]: python version
2929
# [2]: random 8-character ID to avoid collisions with other runs
30-
python37=("python3.7" "3.7" $(xxd -l 4 -c 4 -p < /dev/random))
3130
python38=("python3.8" "3.8" $(xxd -l 4 -c 4 -p < /dev/random))
3231
python39=("python3.9" "3.9" $(xxd -l 4 -c 4 -p < /dev/random))
3332
python310=("python3.10" "3.10" $(xxd -l 4 -c 4 -p < /dev/random))
3433
python311=("python3.11" "3.11" $(xxd -l 4 -c 4 -p < /dev/random))
3534
python312=("python3.12" "3.12" $(xxd -l 4 -c 4 -p < /dev/random))
3635

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

3938
if [ -z "$RUNTIME_PARAM" ]; then
4039
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=("3.7" "3.8" "3.9" "3.10" "3.11" "3.12")
11+
PYTHON_VERSIONS=("3.8" "3.9" "3.10" "3.11" "3.12")
1212

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

scripts/sign_layers.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ set -e
99

1010
LAYER_DIR=".layers"
1111
LAYER_FILES=(
12-
"datadog_lambda_py-amd64-3.7.zip"
1312
"datadog_lambda_py-amd64-3.8.zip"
1413
"datadog_lambda_py-arm64-3.8.zip"
1514
"datadog_lambda_py-amd64-3.9.zip"

0 commit comments

Comments
 (0)