Skip to content

build(test-lambda-function): Migrate to uv and pyproject.toml#33

Merged
ericapisani merged 1 commit into
mainfrom
PY-2460-test-lambda-function
May 21, 2026
Merged

build(test-lambda-function): Migrate to uv and pyproject.toml#33
ericapisani merged 1 commit into
mainfrom
PY-2460-test-lambda-function

Conversation

@ericapisani

Copy link
Copy Markdown
Member

Summary

  • Replace pip/requirements.txt with uv/pyproject.toml for dependency management
  • Update build.sh to use uv pip install instead of pip install
  • Remove legacy requirements.txt

Refs PY-2460

Test plan

  • Verify pyproject.toml includes all dependencies from the original requirements.txt
  • Verify build.sh uses uv
  • Verify requirements.txt is removed

🤖 Generated with Claude Code

Replace pip/requirements.txt with uv/pyproject.toml for dependency
management. Update build.sh to use uv pip install instead of pip.

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

linear-code Bot commented May 21, 2026

Copy link
Copy Markdown

PY-2460

rm -rf ./python_with_sentry/package/*

pip install --target ./python_with_sentry/package -r requirements.txt
uv pip install --target ./python_with_sentry/package -r pyproject.toml

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 command uv pip install -r pyproject.toml is invalid. The -r flag expects a requirements file, not a TOML file, which will cause the build script to fail.
Severity: CRITICAL

Suggested Fix

Replace uv pip install -r pyproject.toml with the correct command to install dependencies from the current project's pyproject.toml. The suggested command is uv pip install --target ./python_with_sentry/package .. This correctly reads the project definition and installs dependencies into the specified target directory.

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-function/build.sh#L11

Potential issue: The build script `test-lambda-function/build.sh` uses the command `uv
pip install -r pyproject.toml`. The `-r` flag is for line-by-line requirements files,
but `pyproject.toml` is a TOML-formatted file, which `uv` cannot parse in this context.
Because the script enables `set -euo pipefail`, this invalid command will cause an
immediate error and halt the entire build process. As a result, the lambda package will
not be created, and any deployment relying on this script will fail.

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

@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 b1aff78. Configure here.

rm -rf ./python_with_sentry/package/*

pip install --target ./python_with_sentry/package -r requirements.txt
uv pip install --target ./python_with_sentry/package -r pyproject.toml

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Editable SDK breaks Lambda zip

High Severity

build.sh vendors deps with uv pip install --target then zips only that folder, but pyproject.toml pins sentry-sdk as an editable path under ../../sentry-python. Editable installs typically add .pth pointers instead of copying sources, so the Lambda archive can ship without a usable sentry_sdk at runtime.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit b1aff78. Configure here.

rm -rf ./python_with_sentry/package/*

pip install --target ./python_with_sentry/package -r requirements.txt
uv pip install --target ./python_with_sentry/package -r pyproject.toml

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

uv not on PATH after install

Medium Severity

When uv is missing, build.sh runs the Astral installer then immediately calls uv pip install. The installer updates shell profiles for future sessions but does not put uv on PATH in the current non-interactive script, so the next line can fail with “command not found” under set -e.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit b1aff78. Configure here.

@ericapisani ericapisani merged commit 5464375 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