Skip to content

build(test-celery-sentry-propagate-traces): Migrate from pip to uv#66

Merged
ericapisani merged 1 commit into
mainfrom
PY-2435-test-celery-sentry-propagate-traces
May 22, 2026
Merged

build(test-celery-sentry-propagate-traces): Migrate from pip to uv#66
ericapisani merged 1 commit into
mainfrom
PY-2435-test-celery-sentry-propagate-traces

Conversation

@ericapisani

Copy link
Copy Markdown
Member

Summary

  • Replace requirements.txt with pyproject.toml for dependency management
  • Update run.sh and run-celery.sh to use uv run instead of manual venv/pip workflow
  • Part of PY-2428 migration effort

Test plan

  • Run ./run-celery.sh and verify the celery worker starts
  • Run ./run.sh and verify the app runs correctly

🤖 Generated with Claude Code

Replace requirements.txt with pyproject.toml and update run.sh and
run-celery.sh to use uv for dependency management and script execution.

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

linear-code Bot commented May 22, 2026

Copy link
Copy Markdown

PY-2435

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 f2352f9. Configure here.

python -m pip install -r requirements.txt

python main.py No newline at end of file
uv run python main.py

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, both scripts install it via curl | sh and then immediately call uv run. The installer updates shell profile files for future sessions but does not put uv on PATH in the current bash process, so the next line often fails with uv: command not found on a first-time machine.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f2352f9. Configure here.

Comment on lines +4 to +10
if ! command -v uv &> /dev/null; then
curl -LsSf https://astral.sh/uv/install.sh | sh
fi

redis-server --daemonize yes

celery -A tasks.app worker --loglevel=DEBUG -c 1
uv run celery -A tasks.app worker --loglevel=DEBUG -c 1

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 fails to update the current shell's PATH, causing subsequent uv commands to fail with command not found on a fresh system.
Severity: HIGH

Suggested Fix

After the uv installation block, explicitly add the binary's directory to the PATH for the current session. For example, add export PATH="$HOME/.local/bin:$PATH" before the first call to uv.

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-celery-sentry-propagate-traces/run-celery.sh#L4-L10

Potential issue: The script checks if `uv` is installed and, if not, installs it. The
`uv` installer adds its binary directory to the `PATH` in shell profile files, but these
changes only take effect in new shell sessions. The current script, which has `set -euo
pipefail` enabled, immediately attempts to execute `uv run ...` without updating the
current session's `PATH`. This results in a `command not found` error, causing the
script to abort on any system where `uv` is not already installed.

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

@ericapisani ericapisani merged commit 64e63e7 into main May 22, 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