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

dependencies = [
"ipdb>=0.13.13",
"numpy>=2.2.4",
"streamlit>=1.43.2",
"sentry-sdk",
]

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

This file was deleted.

16 changes: 5 additions & 11 deletions test-streamlit/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


streamlit run main.py
uv run streamlit run 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 uses uv immediately after installation without updating the PATH, causing a 'command not found' error in environments where ~/.local/bin is not on the PATH.
Severity: HIGH

Suggested Fix

After the uv installation command, source the environment file to update the PATH for the current session. Add source "$HOME/.local/bin/env" before the uv run command to ensure the uv binary is found.

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

Potential issue: The script installs `uv` via `curl | sh` but then immediately attempts
to execute it in the same shell session. The installer modifies shell profile files to
add `uv` to the `PATH`, but these changes are not applied to the currently-running
script. On systems where `~/.local/bin` is not already in the `PATH`, such as minimal CI
environments or fresh macOS systems, the `uv` command will not be found. Since the
script uses `set -euo pipefail`, this will cause the script to fail with a 'command not
found' error and exit immediately.

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

Loading