Skip to content

build(test-django-asgi-upload): Migrate to uv and pyproject.toml#13

Merged
ericapisani merged 1 commit into
mainfrom
PY-2440-test-django-asgi-upload
May 21, 2026
Merged

build(test-django-asgi-upload): Migrate to uv and pyproject.toml#13
ericapisani merged 1 commit into
mainfrom
PY-2440-test-django-asgi-upload

Conversation

@ericapisani

Copy link
Copy Markdown
Member

Summary

  • Replace pip/requirements.txt with uv/pyproject.toml for dependency management
  • Update run.sh to use uv run instead of manual venv creation and pip install
  • Remove legacy requirements.txt

Refs PY-2440

Test plan

  • Verify pyproject.toml includes all dependencies from the original requirements.txt
  • Verify run.sh uses uv run
  • Verify requirements.txt is removed

🤖 Generated with Claude Code

Replace pip/requirements.txt with uv/pyproject.toml for dependency
management. Update run.sh to use uv run instead of manual venv
creation and pip install.

Refs PY-2440
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@linear-code

linear-code Bot commented May 21, 2026

Copy link
Copy Markdown

PY-2440

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit cf956fc. Configure here.

[project]
name = "test-django-asgi-upload"
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.

Python version pin mismatch

Medium Severity

The new requires-python = ">=3.12" conflicts with the existing .python-version file still pinned to 3.11. uv run in this directory can pick 3.11 from pyenv while the project metadata requires 3.12+, so dependency sync or startup fails after the migration.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit cf956fc. Configure here.

Comment on lines +4 to 9
if ! command -v uv &> /dev/null; then
curl -LsSf https://astral.sh/uv/install.sh | sh
fi

cd mysite

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 if it's not present but fails to update the PATH for the current session, causing the subsequent uv command to fail.
Severity: HIGH

Suggested Fix

After installing uv, update the PATH for the current shell session. You can do this by adding export PATH="$HOME/.local/bin:$PATH" immediately after the installation command within the if block. This will make the uv binary available to the rest of the script.

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-asgi-upload/run.sh#L4-L9

Potential issue: When `uv` is not pre-installed, the script attempts to install it using
the `astral.sh` installer. This installer updates shell profile files to add the
binary's location to the `PATH`, but these changes only take effect in new shell
sessions. The current script's environment is not updated. Consequently, the subsequent
call to `uv run daphne mysite.asgi:application` fails with a "command not found" error.
Since the script is configured with `set -euo pipefail`, this error will cause the
script to terminate prematurely.

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

@ericapisani ericapisani merged commit 2f29a25 into main May 21, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant