Skip to content

build(test-celery-accumulating-baggage): Migrate from pip to uv#63

Merged
ericapisani merged 1 commit into
mainfrom
PY-2432-test-celery-accumulating-baggage
May 22, 2026
Merged

build(test-celery-accumulating-baggage): Migrate from pip to uv#63
ericapisani merged 1 commit into
mainfrom
PY-2432-test-celery-accumulating-baggage

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 correctly
  • 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-2432
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@linear-code

linear-code Bot commented May 22, 2026

Copy link
Copy Markdown

PY-2432

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 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 7824e3e. Configure here.

[project]
name = "test-celery-accumulating-baggage"
version = "0"
requires-python = ">=3.12"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Python 3.12 requirement mismatch

High Severity

The pyproject.toml now requires Python 3.12+, but the .python-version file still pins 3.11.6. This mismatch can cause uv run to fail, preventing the project from starting or running scripts like run.sh and run-celery.sh.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 7824e3e. 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 install lacks PATH refresh

Medium Severity

The uv installer doesn't update the PATH for the current shell, causing uv run to fail with "command not found" immediately after installation. This is particularly an issue if ~/.local/bin isn't already on PATH, and set -euo pipefail ensures the script exits.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 7824e3e. Configure here.

[project]
name = "test-celery-accumulating-baggage"
version = "0"
requires-python = ">=3.12"

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 pyproject.toml requires Python >=3.12, but .python-version pins 3.11.6. This conflict will cause uv run commands to fail.
Severity: HIGH

Suggested Fix

Align the Python versions. Either change requires-python in pyproject.toml to ">=3.11.6" or update the version in .python-version to 3.12 or a compatible newer version.

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-accumulating-baggage/pyproject.toml#L4

Potential issue: The `pyproject.toml` file specifies `requires-python = ">=3.12"`, while
the `.python-version` file in the same directory pins the version to `3.11.6`. When `uv
run` is executed, it reads both files and detects that the pinned interpreter version
does not satisfy the project's requirement. This will cause commands like `uv run celery
...` and `uv run python main.py` to fail with an incompatibility error on every
invocation in both `run.sh` and `run-celery.sh`.

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

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

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 uv command will not be found immediately after installation because the script does not update the current shell's PATH.
Severity: HIGH

Suggested Fix

After the installation command, add a line to update the PATH for the current session, such as export PATH="$HOME/.local/bin:$PATH", before calling uv run.

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-accumulating-baggage/run-celery.sh#L4-L6

Potential issue: The `run-celery.sh` and `run.sh` scripts attempt to install `uv` if
it's missing, but the installer does not update the `PATH` for the current shell
session. Consequently, the subsequent `uv run` command will fail with a "command not
found" error on any system where `uv` is not already installed and in the `PATH`. This
makes the scripts unreliable for first-time users.

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

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