Skip to content

Commit dde0fdd

Browse files
ericapisaniclaude
andauthored
build(test-lambda-container): Migrate to uv and pyproject.toml (#32)
Replace pip/requirements.txt with uv/pyproject.toml for dependency management. Update Dockerfile to use uv for installing dependencies. Fixes PY-2459 Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 5464375 commit dde0fdd

3 files changed

Lines changed: 18 additions & 8 deletions

File tree

test-lambda-container/Dockerfile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,20 @@ FROM public.ecr.aws/lambda/python:3.11
33
# Add Sentry Layer
44
COPY --from=public.ecr.aws/sentry/sentry-python-serverless-sdk:6 /opt/ /opt
55

6-
# Copy requirements.txt
7-
COPY requirements.txt ${LAMBDA_TASK_ROOT}
6+
# Install uv
7+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
8+
9+
# Copy project files
10+
COPY pyproject.toml ${LAMBDA_TASK_ROOT}
811

912
# Copy function code
1013
COPY lambda_function.py ${LAMBDA_TASK_ROOT}
1114

1215
# Install the specified packages
13-
RUN pip install -r requirements.txt
16+
RUN uv pip install --system --no-cache -r pyproject.toml
1417

1518
ENV SENTRY_INITIAL_HANDLER="lambda_function.handler"
1619
ENV SENTRY_DSN="https://d655584d05f14c58b86e9034aab6817f@o447951.ingest.sentry.io/5461230"
1720
ENV SENTRY_TRACES_SAMPLE_RATE="1.0"
1821

19-
# Set the CMD to your handler (could also be done as a parameter override outside of the Dockerfile)
20-
#CMD [ "lambda_function.handler" ]
21-
2222
CMD ["sentry_sdk.integrations.init_serverless_sdk.sentry_lambda_handler"]
23-
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[project]
2+
name = "test-lambda-container"
3+
version = "0"
4+
requires-python = ">=3.11"
5+
6+
dependencies = [
7+
"boto3>=1.38.0",
8+
"sentry-sdk",
9+
]
10+
11+
[tool.uv.sources]
12+
sentry-sdk = { path = "../../sentry-python", editable = true }

test-lambda-container/requirements.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)