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()'