Skip to content

Commit 65f5f30

Browse files
ericapisaniclaude
andcommitted
build(test-celery-without-django): Migrate from pip to uv
Replace requirements.txt with pyproject.toml and update run.sh and run-celery.sh to use uv for dependency management and script execution. Refs PY-2436 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4344f7e commit 65f5f30

4 files changed

Lines changed: 24 additions & 34 deletions

File tree

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

test-celery-without-django/requirements.txt

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,15 @@
11
#!/usr/bin/env bash
2-
3-
# exit on first error
42
set -euo pipefail
53

6-
# Delete Celery beat schedule because because when switching versions
7-
# a wrong schedule will cause strange errors
8-
rm -f celerybeat-schedule
4+
if ! command -v uv &> /dev/null; then
5+
curl -LsSf https://astral.sh/uv/install.sh | sh
6+
fi
97

10-
# Delete redis database (empty the queue)
8+
rm -f celerybeat-schedule
119
rm -rf dump.rdb
1210

13-
# create and activate virtual environment
14-
python -m venv .venv
15-
source .venv/bin/activate
16-
17-
# Install (or update) requirements
18-
pip install -r requirements.txt
19-
20-
# Start redis server
2111
redis-server --daemonize yes
2212

23-
# Run Celery and beat in the same process
24-
celery -A tasks.app worker \
13+
uv run celery -A tasks.app worker \
2514
--concurrency=1 \
2615
--max-tasks-per-child=1
27-
28-
# --loglevel=DEBUG \

test-celery-without-django/run.sh

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
#!/usr/bin/env bash
2+
set -euo pipefail
23

3-
# exit on first error
4-
set -xe
4+
if ! command -v uv &> /dev/null; then
5+
curl -LsSf https://astral.sh/uv/install.sh | sh
6+
fi
57

6-
# create and activate virtual environment
7-
python -m venv .venv
8-
source .venv/bin/activate
9-
10-
# Install (or update) requirements
11-
python -m pip install -r requirements.txt
12-
13-
python main.py
8+
uv run python main.py

0 commit comments

Comments
 (0)