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

dependencies = [
"ipdb>=0.13.13",
"sanic>=24.12.0",
"sentry-sdk[sanic]",
]

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

This file was deleted.

16 changes: 5 additions & 11 deletions test-python312/run-sanic.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


sanic server
uv run sanic server
16 changes: 5 additions & 11 deletions test-python312/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 fails to update the PATH for the current session, causing the subsequent uv run command to fail.
Severity: HIGH

Suggested Fix

After the installation step, explicitly add the uv installation directory to the PATH environment variable for the current script's execution. For example, add export PATH="$HOME/.local/bin:$PATH" before the uv run command.

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

Potential issue: The script attempts to install `uv` by piping an installation script to
`sh`. This installer runs in a subprocess and cannot modify the `PATH` environment
variable of the parent script. Consequently, if the `uv` installation directory is not
already in the `PATH`, the subsequent `uv run` command will fail with a 'command not
found' error. Because `set -euo pipefail` is enabled, this failure will cause the script
to exit immediately, breaking the test run on any system where `uv` is not pre-installed
in a standard location.

Also affects:

  • test-python312/run-sanic.sh

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

Loading