Skip to content

build(test-flask-otel): Migrate to uv and pyproject.toml#27

Merged
ericapisani merged 1 commit into
mainfrom
PY-2454-test-flask-otel
May 21, 2026
Merged

build(test-flask-otel): Migrate to uv and pyproject.toml#27
ericapisani merged 1 commit into
mainfrom
PY-2454-test-flask-otel

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-2454

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-2454
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@linear-code

linear-code Bot commented May 21, 2026

Copy link
Copy Markdown

PY-2454

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 9e4991d. Configure here.

Comment thread test-flask-otel/run.sh

# Run Flask application on localhost:5000
flask --app app run No newline at end of file
uv run flask --app app run

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uv missing after installer subshell

Medium Severity

When uv is not on PATH, run.sh installs it via curl … | sh, then immediately runs uv run. The installer runs in a subshell and does not update the parent shell’s PATH, so the next line often fails with “command not found” on a fresh machine unless ~/.local/bin was already configured.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 9e4991d. Configure here.

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

# Run Flask application on localhost:5000
flask --app app run No newline at end of file
uv run flask --app app run

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 calls uv run immediately after installing uv, but the executable's path is not added to the current shell's $PATH, causing a "command not found" error.
Severity: HIGH

Suggested Fix

After the uv installation line, explicitly add the installation directory to the $PATH for the current script session, for example: export PATH="$HOME/.local/bin:$PATH". This ensures the uv command is available for subsequent steps.

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-flask-otel/run.sh#L4-L8

Potential issue: The script installs `uv` using `curl -LsSf
https://astral.sh/uv/install.sh | sh`. This installer places the `uv` binary in a
directory like `~/.local/bin` and updates shell profile files, but these changes do not
apply to the currently running script's environment. Consequently, the subsequent call
to `uv run` fails because the shell cannot find the `uv` executable in its `$PATH`.
Since the script is configured with `set -euo pipefail`, this failure will cause the
script to exit prematurely.

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

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