Skip to content

build(test-threading-logger): Migrate from pip to uv#53

Merged
ericapisani merged 1 commit into
mainfrom
PY-2480-test-threading-logger
May 21, 2026
Merged

build(test-threading-logger): Migrate from pip to uv#53
ericapisani merged 1 commit into
mainfrom
PY-2480-test-threading-logger

Conversation

@ericapisani

Copy link
Copy Markdown
Member

Summary

  • Replace requirements.txt with pyproject.toml for dependency management
  • Update run.sh to use uv run instead of manual venv/pip workflow
  • Part of PY-2428 migration effort

Test plan

  • Run ./run.sh and verify the app runs correctly

🤖 Generated with Claude Code

Replace requirements.txt with pyproject.toml and update run.sh to use
uv for dependency management and script execution.

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

linear-code Bot commented May 21, 2026

Copy link
Copy Markdown

PY-2480

PY-2428

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

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 doesn't update the current shell's $PATH. The subsequent call to uv fails because the command cannot be found, causing the script to exit.
Severity: MEDIUM

Suggested Fix

After installing uv, source the relevant shell configuration file (e.g., source ~/.bashrc) or find the uv binary and call it using its absolute path (e.g., ~/.cargo/bin/uv run ...) to ensure it's available in the current script's environment.

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-threading-logger/run.sh#L4-L8

Potential issue: The `run.sh` script attempts to install the `uv` tool if it's not
present. The installer adds the `uv` binary's location to the `$PATH` by modifying shell
configuration files (e.g., `~/.bashrc`). However, these changes are not sourced by the
currently running script. Consequently, when the script immediately calls `uv run python
main.py`, the shell cannot find the `uv` command because its `$PATH` is not updated.
Since the script uses `set -euo pipefail`, this 'command not found' error causes the
script to exit prematurely on its first run on a clean system.

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

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