Skip to content

build(test-celery-beat-parent-span-id): Migrate from pip to uv#64

Merged
ericapisani merged 1 commit into
mainfrom
PY-2433-test-celery-beat-parent-span-id
May 22, 2026
Merged

build(test-celery-beat-parent-span-id): Migrate from pip to uv#64
ericapisani merged 1 commit into
mainfrom
PY-2433-test-celery-beat-parent-span-id

Conversation

@ericapisani

Copy link
Copy Markdown
Member

Summary

  • Replace requirements.txt with pyproject.toml for dependency management
  • Update run-beat.sh, run-celery.sh, run-flask.sh, and start-task.sh to use uv run
  • Part of PY-2428 migration effort

Test plan

  • Run ./run-celery.sh and verify the celery worker starts
  • Run ./run-beat.sh and verify celery beat starts
  • Run ./run-flask.sh and verify the Flask app starts
  • Run ./start-task.sh to trigger a task

🤖 Generated with Claude Code

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

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

linear-code Bot commented May 22, 2026

Copy link
Copy Markdown

PY-2433

PY-2428

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 beat \
uv run celery -A tasks.app beat \

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, causing the subsequent uv run command to fail if uv wasn't already installed.
Severity: HIGH

Suggested Fix

After the uv installation command, source the appropriate shell profile file (e.g., source ~/.bashrc) or explicitly add the uv binary's directory to the PATH environment variable for the current script session. For example: export PATH="$HOME/.cargo/bin:$PATH".

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-beat-parent-span-id/run-beat.sh#L4-L10

Potential issue: When `uv` is not installed, the script attempts to install it. However,
the installer only updates shell profile files for future sessions and does not modify
the `PATH` of the current running shell. Because `set -euo pipefail` is enabled, the
script immediately fails and exits on the next line when it tries to execute `uv run
...` and the command is not found. This same issue is present in `run-celery.sh` and
`run-flask.sh`.

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

@ericapisani ericapisani merged commit 7378b9f into main May 22, 2026
11 checks passed

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

redis-server --daemonize yes

flask --app main run No newline at end of file
uv run flask --app main run

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Same-shell uv PATH not updated

Medium Severity

The scripts install uv via the Astral installer, which places the binary in ~/.local/bin. This installer doesn't update the PATH for the current non-interactive shell, causing subsequent uv run commands to fail with "command not found".

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit dcb02bd. Configure here.

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