Skip to content

build(test-potel-aws-lambda): Migrate from pip to uv#58

Merged
ericapisani merged 1 commit into
mainfrom
PY-2485-test-potel-aws-lambda
May 21, 2026
Merged

build(test-potel-aws-lambda): Migrate from pip to uv#58
ericapisani merged 1 commit into
mainfrom
PY-2485-test-potel-aws-lambda

Conversation

@ericapisani

Copy link
Copy Markdown
Member

Summary

  • Replace lambda_function/requirements.txt with lambda_function/pyproject.toml
  • Update deploy.sh to use uv pip install instead of pip for Lambda packaging
  • Part of PY-2428 migration effort

Test plan

  • Run ./deploy.sh and verify the Lambda function deploys correctly

🤖 Generated with Claude Code

Replace lambda_function/requirements.txt with pyproject.toml and update
deploy.sh to use uv pip install for Lambda packaging.

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

linear-code Bot commented May 21, 2026

Copy link
Copy Markdown

PY-2485

PY-2428

@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 1 potential issue.

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 541594f. Configure here.

if ! command -v uv &> /dev/null; then
curl -LsSf https://astral.sh/uv/install.sh | sh
fi
uv pip install --system --no-cache -r $TEMP_DIR/pyproject.toml --target $TEMP_DIR/

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 missing from PATH after install

Medium Severity

When uv is not already on PATH, deploy.sh runs the Astral installer and immediately calls uv pip install. The installer puts uv under ~/.local/bin and only updates future shells, so the same script can exit with “command not found” and never build the Lambda zip.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 541594f. Configure here.

Comment on lines +58 to +61
if ! command -v uv &> /dev/null; then
curl -LsSf https://astral.sh/uv/install.sh | sh
fi
uv pip install --system --no-cache -r $TEMP_DIR/pyproject.toml --target $TEMP_DIR/

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 script installs uv but doesn't update the current shell's PATH. The subsequent uv pip install command will fail, aborting the deployment due to set -e.
Severity: CRITICAL

Suggested Fix

After the uv installation line, add source "$HOME/.local/bin/env" or export PATH="$HOME/.local/bin:$PATH" to update the PATH for the current shell session. This will ensure the uv command is found in the subsequent step.

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-potel-aws-lambda/deploy.sh#L58-L61

Potential issue: The `deploy.sh` script attempts to install `uv` if it's not found using
the official installer. However, this installer only updates shell configuration files
for future sessions and does not modify the `PATH` of the current, running shell. The
script immediately proceeds to call `uv pip install ...` in the same session. Because
the `uv` binary's location (`~/.local/bin`) is not yet in the `PATH`, the command will
fail with a "command not found" error. Since `set -e` is active, this failure will cause
the entire deployment script to abort on any machine that does not already have `uv`
installed.

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

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