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
13 changes: 13 additions & 0 deletions test-clickhouse-driver/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[project]
name = "test-clickhouse-driver"
version = "0"
requires-python = ">=3.12"

dependencies = [
"clickhouse-driver>=0.2.9",
"ipdb>=0.13.13",
"sentry-sdk",
]

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

This file was deleted.

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

# exit on first error
set -xe
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
python -m pip install -r requirements.txt


python main.py
uv run python main.py
Comment on lines +4 to +8

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 for the current shell session, causing the subsequent uv run command to fail.
Severity: HIGH

Suggested Fix

After installing uv, update the PATH for the current session before uv is called. For example, add export PATH="$HOME/.local/bin:$PATH" to the script. This ensures the uv binary is found and executed within the same script run.

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-clickhouse-driver/run.sh#L4-L8

Potential issue: The script installs the `uv` package if it is not found. However, the
installer adds the `uv` binary to a directory like `~/.local/bin` and updates shell
profile files for future sessions, but it does not modify the `PATH` of the current
running shell. Consequently, the subsequent command `uv run python main.py` will fail
with a 'command not found' error in any environment where `uv` was not previously
installed and in the `PATH`, such as a clean CI or Docker container.

Did we get this right? 👍 / 👎 to inform future reviews.

Loading