build(test-redis-asyncio): Migrate from pip to uv#47
Conversation
Replace requirements.txt with pyproject.toml and update run.sh to use uv for dependency management and script execution. Refs PY-2474 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
| [project] | ||
| name = "test-redis-asyncio" | ||
| version = "0" | ||
| requires-python = ">=3.12" |
There was a problem hiding this comment.
Bug: The Python version 3.11 in .python-version conflicts with the >=3.12 requirement in pyproject.toml, causing uv run to fail.
Severity: HIGH
Suggested Fix
Align the Python versions. Either update the .python-version file to a version that satisfies >=3.12 (e.g., 3.12), or adjust the requires-python constraint in pyproject.toml to ">=3.11" to match the existing environment.
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-asyncio/pyproject.toml#L4
Potential issue: The `pyproject.toml` file specifies a Python requirement of `>=3.12`,
while the repository's `.python-version` file is pinned to `3.11`. When `uv run` is
executed, it detects this incompatibility and exits with an error. Because the `run.sh`
script uses `set -euo pipefail`, this error will cause the entire script to terminate,
preventing the application from running.
Did we get this right? 👍 / 👎 to inform future reviews.
| if ! command -v uv &> /dev/null; then | ||
| curl -LsSf https://astral.sh/uv/install.sh | sh | ||
| fi |
There was a problem hiding this comment.
Bug: The script installs uv but doesn't update the PATH in the current session, causing the uv run command to fail.
Severity: HIGH
Suggested Fix
After the installation command, add source "$HOME/.cargo/env" or the equivalent command suggested by the uv installer's output to update the PATH for the current session. This will make the uv command available for subsequent lines in the script.
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-asyncio/run.sh#L4-L6
Potential issue: When `uv` is not already installed, the `run.sh` script installs it
using `curl`. However, the installer only modifies shell configuration files (like
`~/.bashrc`) and does not add `uv` to the `PATH` for the current, running shell session.
Consequently, the subsequent `uv run` command fails with a "command not found" error.
Since the script is configured with `set -euo pipefail`, this error will halt execution
immediately.
Did we get this right? 👍 / 👎 to inform future reviews.
Summary
requirements.txtwithpyproject.tomlfor dependency managementrun.shto useuv runinstead of manual venv/pip workflowTest plan
./run.shand verify redis-server starts and the app runs correctly🤖 Generated with Claude Code