Skip to content

build(test-python312): Migrate to uv and pyproject.toml#44

Merged
ericapisani merged 1 commit into
mainfrom
PY-2471-test-python312
May 21, 2026
Merged

build(test-python312): Migrate to uv and pyproject.toml#44
ericapisani merged 1 commit into
mainfrom
PY-2471-test-python312

Conversation

@ericapisani

Copy link
Copy Markdown
Member

Summary

  • Replace pip/requirements.txt with uv/pyproject.toml
  • Update run.sh and run-sanic.sh to use uv run
  • Remove legacy requirements.txt

Refs PY-2471

🤖 Generated with Claude Code

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>
@linear-code

linear-code Bot commented May 21, 2026

Copy link
Copy Markdown

PY-2471

Comment thread test-python312/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


python main.py No newline at end of file
uv run python 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 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.

@ericapisani ericapisani merged commit f0c4d3c 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