Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions test-js-python-redis-celery/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[project]
name = "test-js-python-redis-celery"
version = "0"
requires-python = ">=3.12"

dependencies = [
"celery>=5.4.0",
"fastapi>=0.115.11",
"ipdb>=0.13.13",
"redis>=5.2.1",
"sentry-sdk[fastapi,celery]",
"uvicorn>=0.34.0",
]

[tool.uv.sources]
sentry-sdk = { path = "../../sentry-python", editable = true }
11 changes: 0 additions & 11 deletions test-js-python-redis-celery/requirements.txt

This file was deleted.

14 changes: 4 additions & 10 deletions test-js-python-redis-celery/run-celery.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
#!/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 --loglevel=DEBUG -c 1
uv run celery -A tasks.app worker --loglevel=DEBUG -c 1
11 changes: 4 additions & 7 deletions test-js-python-redis-celery/run-webserver.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
#!/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
if ! command -v uv &> /dev/null; then
curl -LsSf https://astral.sh/uv/install.sh | sh
fi

python -m http.server 5000
uv run python -m http.server 5000
16 changes: 5 additions & 11 deletions test-js-python-redis-celery/run.sh
Original file line number Diff line number Diff line change
@@ -1,14 +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
pip install -r requirements.txt

# Run FastAPI application on localhost:8000
uvicorn main:app --reload
uv run uvicorn main:app --reload
Comment on lines +4 to +8

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The script installs uv but doesn't update the PATH in the current session, causing the subsequent uv run command to fail with "command not found".
Severity: HIGH

Suggested Fix

After the uv installation command, add export PATH="$HOME/.local/bin:$PATH" or source "$HOME/.local/bin/env" to make the uv binary available in the current shell session's PATH.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: test-js-python-redis-celery/run.sh#L4-L8

Potential issue: The script installs `uv` using its `install.sh` script if it is not
already present. However, this installer only modifies shell configuration files and
does not update the `PATH` for the current shell session. Because the script is run with
`set -euo pipefail`, the immediate subsequent call to `uv run ...` fails with a "command
not found" error, causing the script to exit prematurely. This issue affects `run.sh`,
`run-celery.sh`, and `run-webserver.sh`.

Also affects:

  • test-js-python-redis-celery/run-celery.sh
  • test-js-python-redis-celery/run-webserver.sh

Did we get this right? 👍 / 👎 to inform future reviews.

Loading