Skip to content

Commit 076b253

Browse files
ericapisaniclaude
andcommitted
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 <noreply@anthropic.com>
1 parent 4344f7e commit 076b253

4 files changed

Lines changed: 22 additions & 28 deletions

File tree

test-dramatiq/pyproject.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[project]
2+
name = "test-dramatiq"
3+
version = "0"
4+
requires-python = ">=3.12"
5+
6+
dependencies = [
7+
"dramatiq>=0.12.0",
8+
"ipdb>=0.13.13",
9+
"redis>=5.2.1",
10+
"sentry-sdk",
11+
]
12+
13+
[tool.uv.sources]
14+
sentry-sdk = { path = "../../sentry-python", editable = true }

test-dramatiq/requirements.txt

Lines changed: 0 additions & 9 deletions
This file was deleted.

test-dramatiq/run-worker.sh

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11
#!/usr/bin/env bash
2-
32
set -euo pipefail
43
reset
54

6-
# Create virtual environment
7-
python -m venv .venv
8-
source .venv/bin/activate
9-
10-
# Install requirements into virtual environment
11-
pip install -r requirements.txt
5+
if ! command -v uv &> /dev/null; then
6+
curl -LsSf https://astral.sh/uv/install.sh | sh
7+
fi
128

13-
# Start a fresh redis server
149
pkill redis-server || true
1510
sleep 1
1611
rm -rf dump.rdb
1712
redis-server --daemonize yes
1813

19-
# Start dramatiq worker
20-
dramatiq --processes 1 main
14+
uv run dramatiq --processes 1 main

test-dramatiq/run.sh

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
#!/usr/bin/env bash
2-
32
set -euo pipefail
43
reset
54

6-
# Create virtual environment
7-
python -m venv .venv
8-
source .venv/bin/activate
9-
10-
# Install requirements into virtual environment
11-
pip install -r requirements.txt
5+
if ! command -v uv &> /dev/null; then
6+
curl -LsSf https://astral.sh/uv/install.sh | sh
7+
fi
128

13-
# Run script that sends task to dramatiq worker
14-
python main.py
9+
uv run python main.py

0 commit comments

Comments
 (0)