build(test-python312): Migrate to uv and pyproject.toml#44
Merged
Conversation
Replace pip/requirements.txt with uv/pyproject.toml for dependency management. Update run.sh and run-sanic.sh to use uv run. Refs PY-2471 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 | ||
|
|
||
|
|
||
| python main.py No newline at end of file | ||
| uv run python main.py |
There was a problem hiding this comment.
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.
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
Refs PY-2471
🤖 Generated with Claude Code