-
Notifications
You must be signed in to change notification settings - Fork 1
build(test-celery-without-django): Migrate from pip to uv #67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| [project] | ||
| name = "test-celery-without-django" | ||
| 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 } |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,28 +1,15 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # exit on first error | ||
| set -euo pipefail | ||
|
|
||
| # Delete Celery beat schedule because because when switching versions | ||
| # a wrong schedule will cause strange errors | ||
| rm -f celerybeat-schedule | ||
| if ! command -v uv &> /dev/null; then | ||
| curl -LsSf https://astral.sh/uv/install.sh | sh | ||
| fi | ||
|
|
||
| # Delete redis database (empty the queue) | ||
| rm -f celerybeat-schedule | ||
| rm -rf dump.rdb | ||
|
|
||
| # create and activate virtual environment | ||
| python -m venv .venv | ||
| source .venv/bin/activate | ||
|
|
||
| # Install (or update) requirements | ||
| pip install -r requirements.txt | ||
|
|
||
| # Start redis server | ||
| redis-server --daemonize yes | ||
|
|
||
| # Run Celery and beat in the same process | ||
| celery -A tasks.app worker \ | ||
| uv run celery -A tasks.app worker \ | ||
| --concurrency=1 \ | ||
| --max-tasks-per-child=1 | ||
|
|
||
| # --loglevel=DEBUG \ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,8 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| # exit on first error | ||
| set -xe | ||
| if ! command -v uv &> /dev/null; then | ||
| curl -LsSf https://astral.sh/uv/install.sh | sh | ||
| fi | ||
|
|
||
| # create and activate virtual environment | ||
| python -m venv .venv | ||
| source .venv/bin/activate | ||
|
|
||
| # Install (or update) requirements | ||
| python -m pip install -r requirements.txt | ||
|
|
||
| python main.py | ||
| uv run python main.py | ||
|
Comment on lines
+4
to
+8
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: The script calls Suggested FixAfter the Prompt for AI AgentDid we get this right? 👍 / 👎 to inform future reviews. |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uv not on PATH after install
Medium Severity
If
uvis missing, the scripts install it, but the installer doesn't makeuvimmediately available on thePATHfor the current shell session. This happens because it updates shell profiles for future sessions or placesuvin~/.local/bin, which may not be on thePATHfor non-interactive runs. Consequently, the immediateuv runcommand fails.Additional Locations (1)
test-celery-without-django/run.sh#L3-L8Reviewed by Cursor Bugbot for commit 65f5f30. Configure here.