Skip to content

Commit 360d296

Browse files
ericapisaniclaude
andauthored
build(test-django-celery-beat-timezone): Migrate to uv and pyproject.toml (#15)
Replace pip/requirements.txt with uv/pyproject.toml for dependency management. Update run.sh and run-celery.sh to use uv run instead of manual venv creation and pip install. Fixes PY-2442 Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 35c46e0 commit 360d296

4 files changed

Lines changed: 29 additions & 39 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[project]
2+
name = "test-django-celery-beat-timezone"
3+
version = "0"
4+
requires-python = ">=3.12"
5+
6+
dependencies = [
7+
"channels[daphne]>=4.2.0",
8+
"django==4.2",
9+
"django-celery-beat>=2.7.0",
10+
"django-debug-toolbar>=5.0.1",
11+
"ipdb>=0.13.13",
12+
"psycopg>=3.2.6",
13+
"redis>=5.2.1",
14+
"sentry-sdk[django,celery]",
15+
]
16+
17+
[tool.uv.sources]
18+
sentry-sdk = { path = "../../sentry-python", editable = true }

test-django-celery-beat-timezone/requirements.txt

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

64
reset
75

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
6+
if ! command -v uv &> /dev/null; then
7+
curl -LsSf https://astral.sh/uv/install.sh | sh
8+
fi
149

1510
redis-server --daemonize yes
1611

1712
cd mysite
1813

19-
celery -A mysite.tasks.app worker \
14+
uv run celery -A mysite.tasks.app worker \
2015
--loglevel=DEBUG \
2116
-B \
2217
-c 1 \
23-
--scheduler django_celery_beat.schedulers:DatabaseScheduler
18+
--scheduler django_celery_beat.schedulers:DatabaseScheduler
Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,12 @@
11
#!/usr/bin/env bash
2+
set -euo pipefail
23

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

138
cd mysite
149

15-
# run migrations
16-
./manage.py migrate
10+
uv run ./manage.py migrate
1711

18-
# Run Django application on localhost:8000
19-
./manage.py runserver 0.0.0.0:8000
20-
#gunicorn movie_search.project.asgi:application -k uvicorn.workers.UvicornWorker
21-
# daphne -b 0.0.0.0 -p 8000 mysite.asgi:application
12+
uv run ./manage.py runserver 0.0.0.0:8000

0 commit comments

Comments
 (0)