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-django-rest-framework-streaming/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[project]
name = "test-django-rest-framework-streaming"
version = "0"
requires-python = ">=3.12"

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 pyproject.toml requires Python >=3.12, but the .python-version file is pinned to 3.11. This conflict will cause uv to fail, preventing the app from starting.
Severity: CRITICAL

Suggested Fix

Align the Python version requirements. Either update the .python-version file to a version that satisfies >=3.12 (e.g., 3.12), or adjust the requires-python constraint in pyproject.toml to ">=3.11" to match the existing environment.

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-django-rest-framework-streaming/pyproject.toml#L4

Potential issue: The `pyproject.toml` file specifies `requires-python = ">=3.12"`, while
the existing `.python-version` file in the same directory pins the Python version to
`3.11`. When the `run.sh` script executes `uv run gunicorn mysite.wsgi:application`, the
`uv` tool will detect this version incompatibility and exit with an error. Because
`run.sh` is configured with `set -euo pipefail`, the script will terminate immediately
upon this error, preventing the Gunicorn server from ever launching and the application
from starting.

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


dependencies = [
"django>=5.2",
"djangorestframework>=3.16.0",
"gunicorn>=23.0.0",
"ipdb>=0.13.13",
"sentry-sdk[django]",
"uvicorn>=0.34.0",
]

[tool.uv.sources]
sentry-sdk = { path = "../../sentry-python", editable = true }
9 changes: 0 additions & 9 deletions test-django-rest-framework-streaming/requirements.txt

This file was deleted.

21 changes: 5 additions & 16 deletions test-django-rest-framework-streaming/run.sh
Original file line number Diff line number Diff line change
@@ -1,19 +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

# run migrations
# ./manage.py migrate

# Run Django application on localhost:8000
# ./manage.py runserver 0.0.0.0:8000
# uvicorn mysite.asgi:application
gunicorn mysite.wsgi:application
uv run gunicorn mysite.wsgi:application
Loading