build(test-streamlit): Migrate from pip to uv#50
Merged
Conversation
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>
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 |
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
requirements.txtwithpyproject.tomlfor dependency managementrun.shto useuv runinstead of manual venv/pip workflowTest plan
./run.shand verify the streamlit app starts correctly🤖 Generated with Claude Code