Skip to content

Commit 9cdd1e9

Browse files
Revert pyproject.toml changes and add environment variable for ddtrace wheel sed command
1 parent aa9cbba commit 9cdd1e9

3 files changed

Lines changed: 10 additions & 32 deletions

File tree

.github/workflows/build_layer.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,10 @@ jobs:
3434
pip download --no-index --no-deps --find-links https://dd-trace-py-builds.s3.amazonaws.com/main/index.html --pre --python-version "${{ matrix.python_version}}" --platform "${PLATFORM_TAG}" ddtrace
3535
echo "wheel_path=$(find . -name "*.whl" | head -n 1)" >> $GITHUB_OUTPUT
3636
37-
- name: Patch pyproject.toml
38-
run: |
39-
echo "Patching pyproject.toml to use latest build of dd-trace-py"
40-
sed -i 's|^ddtrace =.*$|ddtrace = { file = "${{ steps.find-ddtrace-wheel.outputs.wheel_path }}" }|' pyproject.toml
41-
4237
- name: Build layer for Python ${{ matrix.python_version }} on ${{ matrix.arch }}
4338
run: |
4439
echo "Building layer for Python ${{ matrix.python_version }} on ${{ matrix.arch }}"
45-
ARCH=${{ matrix.arch }} PYTHON_VERSION=${{ matrix.python_version }} ./scripts/build_layers.sh
40+
ARCH=${{ matrix.arch }} PYTHON_VERSION=${{ matrix.python_version }} SED_EXPRESSION="s|(ddtrace = )\[[^]]*]|\1{ file = "${{ steps.find-ddtrace-wheel.outputs.wheel_path }}" }|g" ./scripts/build_layers.sh
4641
4742
- name: Upload layer artifact
4843
uses: actions/upload-artifact@v4

pyproject.toml

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,21 @@
11
[tool.poetry]
22
name = "datadog_lambda"
3-
version = "8.123.0.dev0"
3+
version = "8.122.0.dev0"
44
description = "The Datadog AWS Lambda Library"
55
authors = ["Datadog, Inc. <dev@datadoghq.com>"]
6-
7-
[project]
8-
name = "datadog_lambda"
96
license = "Apache-2.0"
107
readme = "README.md"
11-
requires-python = ">=3.8.0,<4"
128
repository = "https://github.com/DataDog/datadog-lambda-python"
139
keywords = [
1410
"datadog",
1511
"aws",
1612
"lambda",
1713
"layer",
1814
]
19-
dependencies = [
20-
"datadog>=0.51.0,<1.0.0",
21-
"wrapt>=1.11.2,<2",
22-
"ddtrace>=3.19.1,<4; python_version>='3.9.0' and python_version < '3.10'",
23-
"ddtrace>=4.1.1,<5; python_version>='3.10.0'",
24-
"ujson>=5.9.0",
25-
]
2615
packages = [
2716
{ include = "datadog_lambda" }
2817
]
2918
classifiers = [
30-
"Programming Language :: Python :: 3 :: Only",
3119
"Programming Language :: Python :: 3.8",
3220
"Programming Language :: Python :: 3.9",
3321
"Programming Language :: Python :: 3.10",
@@ -37,13 +25,14 @@ classifiers = [
3725
"Programming Language :: Python :: 3.14",
3826
]
3927

40-
# can remove tool.poetry.depencies and tool.poetry.extras
41-
# after deprecation of Python 3.8
4228
[tool.poetry.dependencies]
4329
python = ">=3.8.0,<4"
4430
datadog = ">=0.51.0,<1.0.0"
4531
wrapt = "^1.11.2"
46-
ddtrace = ">=3.19.1,<4"
32+
ddtrace = [
33+
{version = ">=3.19.1,<4", python = ">=3.8,<3.10"},
34+
{version = ">=4.1.1,<5", python = ">=3.10"}
35+
]
4736
ujson = ">=5.9.0"
4837
botocore = { version = "^1.34.0", optional = true }
4938
requests = { version ="^2.22.0", optional = true }
@@ -60,18 +49,9 @@ dev = [
6049
"requests",
6150
]
6251

63-
[project.optional-dependencies]
64-
dev = [
65-
"botocore>=1.34.0,<2",
66-
"requests>=2.22.0,<3",
67-
"pytest>=8.0.0,<9",
68-
"pytest-benchmark>=4.0,<5",
69-
"flake8>=5.0.4,<6",
70-
]
71-
7252
[build-system]
7353
requires = ["poetry-core>=1.0.0"]
7454
build-backend = "poetry.core.masonry.api"
7555

7656
[tool.pytest.ini_options]
77-
addopts = "--benchmark-disable --benchmark-autosave"
57+
addopts = "--benchmark-disable --benchmark-autosave"

scripts/build_layers.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ else
4646
PYTHON_VERSIONS=$PYTHON_VERSION
4747
fi
4848

49+
if [ -z "$SED_EXPRESSION"]; then
50+
sed -z -E -i "$SED_EXPRESSION" pyproject.toml
51+
fi
4952

5053
function make_path_absolute {
5154
echo "$(cd "$(dirname "$1")"; pwd)/$(basename "$1")"

0 commit comments

Comments
 (0)