build(test-js-python-redis-celery): Migrate to uv and pyproject.toml#31
Merged
Merged
Conversation
Replace pip/requirements.txt with uv/pyproject.toml for dependency management. Update run scripts to use uv run instead of manual venv creation and pip install. Refs PY-2458 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Comment on lines
+4
to
+8
| if ! command -v uv &> /dev/null; then | ||
| curl -LsSf https://astral.sh/uv/install.sh | sh | ||
| fi | ||
|
|
||
| # create and activate virtual environment | ||
| python -m venv .venv | ||
| source .venv/bin/activate | ||
|
|
||
| # Install (or update) requirements | ||
| pip install -r requirements.txt | ||
|
|
||
| # Run FastAPI application on localhost:8000 | ||
| uvicorn main:app --reload | ||
| uv run uvicorn main:app --reload |
There was a problem hiding this comment.
Bug: The script installs uv but doesn't update the PATH in the current session, causing the subsequent uv run command to fail with "command not found".
Severity: HIGH
Suggested Fix
After the uv installation command, add export PATH="$HOME/.local/bin:$PATH" or source "$HOME/.local/bin/env" to make the uv binary available in the current shell session's 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-js-python-redis-celery/run.sh#L4-L8
Potential issue: The script installs `uv` using its `install.sh` script if it is not
already present. However, this installer only modifies shell configuration files and
does not update the `PATH` for the current shell session. Because the script is run with
`set -euo pipefail`, the immediate subsequent call to `uv run ...` fails with a "command
not found" error, causing the script to exit prematurely. This issue affects `run.sh`,
`run-celery.sh`, and `run-webserver.sh`.
Also affects:
test-js-python-redis-celery/run-celery.shtest-js-python-redis-celery/run-webserver.sh
Did we get this right? 👍 / 👎 to inform future reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pip/requirements.txtwithuv/pyproject.tomlfor dependency managementrun.sh,run-celery.sh, andrun-webserver.shto useuv runrequirements.txtRefs PY-2458
Test plan
pyproject.tomlincludes all dependencies from the originalrequirements.txtuv runrequirements.txtis removed🤖 Generated with Claude Code