Skip to content

build(test-streamlit): Migrate from pip to uv#50

Merged
ericapisani merged 1 commit into
mainfrom
PY-2477-test-streamlit
May 21, 2026
Merged

build(test-streamlit): Migrate from pip to uv#50
ericapisani merged 1 commit into
mainfrom
PY-2477-test-streamlit

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 the streamlit app starts 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-2477
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@linear-code

linear-code Bot commented May 21, 2026

Copy link
Copy Markdown

PY-2477

PY-2428

Comment thread test-streamlit/run.sh
Comment on lines +4 to +8
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

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.

@ericapisani ericapisani merged commit 4b13fa3 into main May 21, 2026
11 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