Skip to content

build(test-lambda-container): Migrate to uv and pyproject.toml#32

Merged
ericapisani merged 1 commit into
mainfrom
PY-2459-test-lambda-container
May 21, 2026
Merged

build(test-lambda-container): Migrate to uv and pyproject.toml#32
ericapisani merged 1 commit into
mainfrom
PY-2459-test-lambda-container

Conversation

@ericapisani

Copy link
Copy Markdown
Member

Summary

  • Replace pip/requirements.txt with uv/pyproject.toml for dependency management
  • Update Dockerfile to install uv and use uv pip install instead of pip install -r requirements.txt
  • Remove legacy requirements.txt

Refs PY-2459

Test plan

  • Verify pyproject.toml includes all dependencies from the original requirements.txt
  • Verify Dockerfile uses uv for dependency installation
  • Verify requirements.txt is removed

🤖 Generated with Claude Code

Replace pip/requirements.txt with uv/pyproject.toml for dependency
management. Update Dockerfile to use uv for installing dependencies.

Refs PY-2459
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@linear-code

linear-code Bot commented May 21, 2026

Copy link
Copy Markdown

PY-2459

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit bac03ac. Configure here.

]

[tool.uv.sources]
sentry-sdk = { path = "../../sentry-python", editable = true }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Local sentry path breaks Docker build

High Severity

The pyproject.toml defines sentry-sdk as an editable path dependency (../../sentry-python). This path is outside the Docker build context and the source isn't copied into the container, causing uv pip install to fail during the image build.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit bac03ac. Configure here.

dependencies = [
"boto3>=1.38.0",
"sentry-sdk",
]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pip sentry-sdk duplicates Lambda layer

Medium Severity

The removed requirements.txt only listed boto3; Sentry for this container test came from the copied serverless layer under /opt/python. The new dependencies list adds sentry-sdk, so uv pip install pulls a second SDK into system site-packages while the image still ships the layer and uses the layer’s sentry_lambda_handler entrypoint, changing which SDK the smoke test exercises.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit bac03ac. Configure here.

Comment on lines +11 to +12
[tool.uv.sources]
sentry-sdk = { path = "../../sentry-python", editable = true }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The pyproject.toml references a local path dependency that is outside the Docker build context, which will either break the build or cause the wrong package version to be tested.
Severity: HIGH

Suggested Fix

Adjust the Docker build process to include the sentry-python source code. This can be achieved by changing the build context to a higher-level directory and adding a COPY instruction in the Dockerfile to bring the ../../sentry-python directory into the container image, allowing the local path dependency to resolve correctly.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: test-lambda-container/pyproject.toml#L11-L12

Potential issue: The `pyproject.toml` file defines `sentry-sdk` as a local editable
dependency with a path (`../../sentry-python`) that is outside the Docker build context
(`test-lambda-container/`). During the Docker build, this path is inaccessible. This
will either cause the build to fail when `uv pip install` cannot find the local
directory, or it may cause `uv` to silently install a public version of `sentry-sdk`
from PyPI. The latter would mean the test container is not testing the local development
code, defeating its primary purpose.

Did we get this right? 👍 / 👎 to inform future reviews.

@ericapisani ericapisani merged commit dde0fdd into main May 21, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant