From af7a7b18766dc5041d23114aee91d27d8e9c85b5 Mon Sep 17 00:00:00 2001 From: Erica Pisani Date: Thu, 21 May 2026 16:39:52 -0400 Subject: [PATCH] build(tmp-celery-flush): Migrate from pip to uv Replace requirements.txt with pyproject.toml and update run-celery.sh and start-task.sh to use uv for dependency management and execution. Refs PY-2482 Co-Authored-By: Claude Opus 4.6 --- tmp-celery-flush/pyproject.toml | 14 ++++++++++++++ tmp-celery-flush/requirements.txt | 6 ------ tmp-celery-flush/run-celery.sh | 15 ++++----------- tmp-celery-flush/start-task.sh | 11 ++++------- 4 files changed, 22 insertions(+), 24 deletions(-) create mode 100644 tmp-celery-flush/pyproject.toml delete mode 100644 tmp-celery-flush/requirements.txt diff --git a/tmp-celery-flush/pyproject.toml b/tmp-celery-flush/pyproject.toml new file mode 100644 index 0000000..ce23ae6 --- /dev/null +++ b/tmp-celery-flush/pyproject.toml @@ -0,0 +1,14 @@ +[project] +name = "tmp-celery-flush" +version = "0" +requires-python = ">=3.12" + +dependencies = [ + "celery>=5.4.0", + "ipdb>=0.13.13", + "redis>=5.2.1", + "sentry-sdk[celery]", +] + +[tool.uv.sources] +sentry-sdk = { path = "../../sentry-python", editable = true } diff --git a/tmp-celery-flush/requirements.txt b/tmp-celery-flush/requirements.txt deleted file mode 100644 index a69bcfa..0000000 --- a/tmp-celery-flush/requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -celery -redis - -ipdb - --e ../../../code/sentry-python # sdk in a sibling folder to this projects folder diff --git a/tmp-celery-flush/run-celery.sh b/tmp-celery-flush/run-celery.sh index 78da366..dcd4ff5 100755 --- a/tmp-celery-flush/run-celery.sh +++ b/tmp-celery-flush/run-celery.sh @@ -1,19 +1,12 @@ #!/usr/bin/env bash - -# exit on first error set -euo pipefail -reset - -# create and activate virtual environment -python -m venv .venv -source .venv/bin/activate - -# Install (or update) requirements -pip install -r requirements.txt +if ! command -v uv &> /dev/null; then + curl -LsSf https://astral.sh/uv/install.sh | sh +fi redis-server --daemonize yes -celery -A tasks.app worker \ +uv run celery -A tasks.app worker \ --loglevel=INFO \ -c 1 diff --git a/tmp-celery-flush/start-task.sh b/tmp-celery-flush/start-task.sh index ae8da03..85b221f 100755 --- a/tmp-celery-flush/start-task.sh +++ b/tmp-celery-flush/start-task.sh @@ -1,11 +1,8 @@ #!/usr/bin/env bash - -# exit on first error set -euo pipefail -# create and activate virtual environment -python -m venv .venv -source .venv/bin/activate +if ! command -v uv &> /dev/null; then + curl -LsSf https://astral.sh/uv/install.sh | sh +fi -# Start task -python -c 'import tasks; tasks.my_task.delay()' \ No newline at end of file +uv run python -c 'import tasks; tasks.my_task.delay()'