From 076b2534ce321e31c8e835d838054cfa9a74e1bd Mon Sep 17 00:00:00 2001 From: Erica Pisani Date: Thu, 21 May 2026 16:20:21 -0400 Subject: [PATCH] build(test-dramatiq): Migrate to uv and pyproject.toml 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 --- test-dramatiq/pyproject.toml | 14 ++++++++++++++ test-dramatiq/requirements.txt | 9 --------- test-dramatiq/run-worker.sh | 14 ++++---------- test-dramatiq/run.sh | 13 ++++--------- 4 files changed, 22 insertions(+), 28 deletions(-) create mode 100644 test-dramatiq/pyproject.toml delete mode 100644 test-dramatiq/requirements.txt diff --git a/test-dramatiq/pyproject.toml b/test-dramatiq/pyproject.toml new file mode 100644 index 0000000..4e70aee --- /dev/null +++ b/test-dramatiq/pyproject.toml @@ -0,0 +1,14 @@ +[project] +name = "test-dramatiq" +version = "0" +requires-python = ">=3.12" + +dependencies = [ + "dramatiq>=0.12.0", + "ipdb>=0.13.13", + "redis>=5.2.1", + "sentry-sdk", +] + +[tool.uv.sources] +sentry-sdk = { path = "../../sentry-python", editable = true } diff --git a/test-dramatiq/requirements.txt b/test-dramatiq/requirements.txt deleted file mode 100644 index 5bd9afc..0000000 --- a/test-dramatiq/requirements.txt +++ /dev/null @@ -1,9 +0,0 @@ -dramatiq - -redis - -ipdb - -# Sentry --e ../../../code/sentry-python # local dev version of sentry python sdk. -# sentry-sdk==2.8.0 # production version of sentry python sdk from PyPI. \ No newline at end of file diff --git a/test-dramatiq/run-worker.sh b/test-dramatiq/run-worker.sh index 8197198..a5f10bd 100755 --- a/test-dramatiq/run-worker.sh +++ b/test-dramatiq/run-worker.sh @@ -1,20 +1,14 @@ #!/usr/bin/env bash - set -euo pipefail reset -# Create virtual environment -python -m venv .venv -source .venv/bin/activate - -# Install requirements into virtual environment -pip install -r requirements.txt +if ! command -v uv &> /dev/null; then + curl -LsSf https://astral.sh/uv/install.sh | sh +fi -# Start a fresh redis server pkill redis-server || true sleep 1 rm -rf dump.rdb redis-server --daemonize yes -# Start dramatiq worker -dramatiq --processes 1 main +uv run dramatiq --processes 1 main diff --git a/test-dramatiq/run.sh b/test-dramatiq/run.sh index d6c0a74..a08057d 100755 --- a/test-dramatiq/run.sh +++ b/test-dramatiq/run.sh @@ -1,14 +1,9 @@ #!/usr/bin/env bash - set -euo pipefail reset -# Create virtual environment -python -m venv .venv -source .venv/bin/activate - -# Install requirements into virtual environment -pip install -r requirements.txt +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