Skip to content

build(test-fastapi-root-path): Migrate to uv and pyproject.toml#24

Merged
ericapisani merged 1 commit into
mainfrom
PY-2451-test-fastapi-root-path
May 21, 2026
Merged

build(test-fastapi-root-path): Migrate to uv and pyproject.toml#24
ericapisani merged 1 commit into
mainfrom
PY-2451-test-fastapi-root-path

Conversation

@ericapisani

Copy link
Copy Markdown
Member

Summary

  • Replace pip/requirements.txt with uv/pyproject.toml for dependency management
  • Update run.sh to use uv run instead of manual venv creation and pip install
  • Remove legacy requirements.txt

Refs PY-2451

Test plan

  • Verify pyproject.toml includes all dependencies from the original requirements.txt
  • Verify run.sh uses uv run
  • Verify requirements.txt is removed

🤖 Generated with Claude Code

Replace pip/requirements.txt with uv/pyproject.toml for dependency
management. Update run.sh to use uv run instead of manual venv
creation and pip install.

Refs PY-2451
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@linear-code

linear-code Bot commented May 21, 2026

Copy link
Copy Markdown

PY-2451

Comment on lines +5 to +9
if ! command -v uv &> /dev/null; then
curl -LsSf https://astral.sh/uv/install.sh | sh
fi

#nginx -c "$(pwd)/nginx.conf"
uv run uvicorn main:app --port 5000 --reload

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 in a subshell, which doesn't update the parent shell's PATH. The subsequent uv command fails with "command not found".
Severity: MEDIUM

Suggested Fix

Source the installer script instead of piping it to a new shell, for example: source <(curl -LsSf https://astral.sh/uv/install.sh). This will run the installer in the current shell process, allowing it to modify the PATH environment variable. Alternatively, explicitly add the installation directory (e.g., $HOME/.cargo/bin) to the PATH after the installation step.

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-fastapi-root-path/run.sh#L5-L9

Potential issue: The `run.sh` script attempts to install `uv` using `curl -LsSf
https://astral.sh/uv/install.sh | sh`. This command runs the installer in a subshell,
which prevents it from modifying the `PATH` environment variable of the main script's
process. Consequently, the next command, `uv run ...`, fails because the shell cannot
find the `uv` executable. Since the script is configured with `set -euo pipefail`, this
"command not found" error will cause the script to terminate, failing the test for any
environment where `uv` is not pre-installed.

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

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