Skip to content

build(test-redis-asyncio): Migrate from pip to uv#47

Merged
ericapisani merged 2 commits into
mainfrom
PY-2474-test-redis-asyncio
May 21, 2026
Merged

build(test-redis-asyncio): Migrate from pip to uv#47
ericapisani merged 2 commits into
mainfrom
PY-2474-test-redis-asyncio

Conversation

@ericapisani

Copy link
Copy Markdown
Member

Summary

  • Replace requirements.txt with pyproject.toml for dependency management
  • Update run.sh to use uv run instead of manual venv/pip workflow
  • Part of PY-2428 migration effort

Test plan

  • Run ./run.sh and verify redis-server starts and the app runs correctly

🤖 Generated with Claude Code

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>
@linear-code

linear-code Bot commented May 21, 2026

Copy link
Copy Markdown

PY-2474

PY-2428

[project]
name = "test-redis-asyncio"
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 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.

Comment thread test-redis-asyncio/run.sh
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 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.

@ericapisani ericapisani merged commit a05d8b2 into main May 21, 2026
9 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