Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test-redis-asyncio/.python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.11
3.12
13 changes: 13 additions & 0 deletions test-redis-asyncio/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[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.


dependencies = [
"ipdb>=0.13.13",
"redis>=5.2.1",
"sentry-sdk",
]

[tool.uv.sources]
sentry-sdk = { path = "../../sentry-python", editable = true }
6 changes: 0 additions & 6 deletions test-redis-asyncio/requirements.txt

This file was deleted.

16 changes: 5 additions & 11 deletions test-redis-asyncio/run.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
#!/usr/bin/env bash
set -euo pipefail

# exit on first error
set -xe

# create and activate virtual environment
python -m venv .venv
source .venv/bin/activate

# Install (or update) requirements
python -m pip install -r requirements.txt
if ! command -v uv &> /dev/null; then
curl -LsSf https://astral.sh/uv/install.sh | sh
fi
Comment on lines +4 to +6

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.


pkill redis-server || true
sleep 1
rm -rf dump.rdb
redis-server --daemonize yes

# Run program
python main.py
uv run python main.py
Loading