build(test-lambda-function): Migrate to uv and pyproject.toml#33
Conversation
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>
| 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ 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 |
There was a problem hiding this comment.
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)
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 |
There was a problem hiding this comment.
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.
Reviewed by Cursor Bugbot for commit b1aff78. Configure here.


Summary
pip/requirements.txtwithuv/pyproject.tomlfor dependency managementbuild.shto useuv pip installinstead ofpip installrequirements.txtRefs PY-2460
Test plan
pyproject.tomlincludes all dependencies from the originalrequirements.txtbuild.shuses uvrequirements.txtis removed🤖 Generated with Claude Code