Skip to content

Commit 76702c7

Browse files
authored
build(test-celery-max-tasks-per-child): Migrate from pip to uv (#65)
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-2434
1 parent 64e63e7 commit 76702c7

4 files changed

Lines changed: 24 additions & 33 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-max-tasks-per-child"
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-max-tasks-per-child/requirements.txt

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

6-
reset
7-
8-
# create and activate virtual environment
9-
python -m venv .venv
10-
source .venv/bin/activate
11-
12-
# Install (or update) requirements
13-
pip install -r requirements.txt
14-
15-
reset
4+
if ! command -v uv &> /dev/null; then
5+
curl -LsSf https://astral.sh/uv/install.sh | sh
6+
fi
167

178
redis-server --daemonize yes
189

1910
export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
2011

21-
celery -A tasks.app worker \
12+
uv run celery -A tasks.app worker \
2213
--loglevel=DEBUG \
2314
-B \
2415
-c 1 \
25-
--max-tasks-per-child 10000 # > output.txt 2> error.txt
16+
--max-tasks-per-child 10000
Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +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-
reset
7-
8-
# create and activate virtual environment
9-
python -m venv .venv
10-
source .venv/bin/activate
11-
12-
# Install (or update) requirements
13-
python -m pip install -r requirements.txt
14-
15-
python main.py
8+
uv run python main.py

0 commit comments

Comments
 (0)