Skip to content

build(test-dramatiq): Migrate to uv and pyproject.toml#19

Merged
ericapisani merged 1 commit into
mainfrom
PY-2446-test-dramatiq
May 21, 2026
Merged

build(test-dramatiq): Migrate to uv and pyproject.toml#19
ericapisani merged 1 commit into
mainfrom
PY-2446-test-dramatiq

Conversation

@ericapisani

Copy link
Copy Markdown
Member

Summary

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

Refs PY-2446

Test plan

  • Verify pyproject.toml includes all dependencies from the original requirements.txt
  • Verify shell scripts use 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 and run-worker.sh to use uv run instead
of manual venv creation and pip install.

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

linear-code Bot commented May 21, 2026

Copy link
Copy Markdown

PY-2446

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

# Run script that sends task to dramatiq worker
python main.py
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 current shell's PATH, causing subsequent uv commands to fail on clean systems.
Severity: HIGH

Suggested Fix

After the uv installation command, either add ~/.local/bin to the PATH for the current session (e.g., export PATH="$HOME/.local/bin:$PATH") or call uv using its full path ($HOME/.local/bin/uv run ...). This ensures the executable is found in the same session it was installed in.

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-dramatiq/run.sh#L5-L9

Potential issue: On a system where `uv` is not pre-installed, the script installs it to
`~/.local/bin/` but does not update the `PATH` of the current shell session. The
subsequent call to `uv run ...` fails with a 'command not found' error. Because the
script is configured with `set -euo pipefail`, this error causes the script to abort
immediately, making it impossible to run on a clean system. The same issue exists in the
`run-worker.sh` script.

Also affects:

  • test-dramatiq/run-worker.sh:5~14

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

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