build(test-redis-cache-module): Migrate from pip to uv#48
Merged
Conversation
Replace requirements.txt with pyproject.toml and update run.sh and run-locust.sh to use uv for dependency management and script execution. Refs PY-2475 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Comment on lines
+5
to
+13
| curl -LsSf https://astral.sh/uv/install.sh | sh | ||
| fi | ||
|
|
||
| pkill redis-server || true | ||
| sleep 1 | ||
| rm -rf dump.rdb | ||
| redis-server --daemonize yes | ||
|
|
||
| # Run program | ||
| python main.py No newline at end of file | ||
| uv run python main.py |
There was a problem hiding this comment.
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
To make uv available in the current shell session, source the environment file created by the installer immediately after installation. Add source ~/.local/bin/env after the curl command that installs uv. Alternatively, you could add ~/.local/bin to the PATH manually with export PATH="$HOME/.local/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-redis-cache-module/run.sh#L5-L13
Potential issue: After installing `uv` via its curl installer, the script immediately
calls `uv run`. The installer modifies shell profile files (e.g., `.bashrc`), but these
changes only apply to new shell sessions, not the currently running script.
Consequently, if `uv` is not pre-installed and its binary directory (`~/.local/bin`) is
not already in the `PATH`, the `uv run` command will fail with a "command not found"
error. Because `set -euo pipefail` is active, this error will cause the script to exit
prematurely. This issue also affects `run-locust.sh`.
Also affects:
run-locust.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
requirements.txtwithpyproject.tomlfor dependency managementrun.shandrun-locust.shto useuv runinstead of manual venv/pip workflowTest plan
./run.shand verify redis-server starts and the app runs correctly./run-locust.shand verify locust starts correctly🤖 Generated with Claude Code