From 71523ba70f849d55e81c91755abcb433c83e93c1 Mon Sep 17 00:00:00 2001 From: Erica Pisani Date: Thu, 21 May 2026 16:00:14 -0400 Subject: [PATCH] build(test-django-rest-framework-xml): Migrate to uv and pyproject.toml 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-2445 Co-Authored-By: Claude Opus 4.6 --- test-django-rest-framework-xml/pyproject.toml | 16 ++++++++++++++ .../requirements.txt | 8 ------- test-django-rest-framework-xml/run.sh | 22 +++++-------------- 3 files changed, 22 insertions(+), 24 deletions(-) create mode 100644 test-django-rest-framework-xml/pyproject.toml delete mode 100644 test-django-rest-framework-xml/requirements.txt diff --git a/test-django-rest-framework-xml/pyproject.toml b/test-django-rest-framework-xml/pyproject.toml new file mode 100644 index 0000000..1e55ded --- /dev/null +++ b/test-django-rest-framework-xml/pyproject.toml @@ -0,0 +1,16 @@ +[project] +name = "test-django-rest-framework-xml" +version = "0" +requires-python = ">=3.12" + +dependencies = [ + "channels[daphne]>=4.2.0", + "django==4.1a1", + "django-debug-toolbar>=5.0.1", + "ipdb>=0.13.13", + "psycopg>=3.2.6", + "sentry-sdk[django]", +] + +[tool.uv.sources] +sentry-sdk = { path = "../../sentry-python", editable = true } diff --git a/test-django-rest-framework-xml/requirements.txt b/test-django-rest-framework-xml/requirements.txt deleted file mode 100644 index f8ba40c..0000000 --- a/test-django-rest-framework-xml/requirements.txt +++ /dev/null @@ -1,8 +0,0 @@ -Django==4.1a1 -psycopg # connection to Postgres database -ipdb -django-debug-toolbar - -channels[daphne] - --e ../../../code/sentry-python # sdk in a sibling folder to this projects folder diff --git a/test-django-rest-framework-xml/run.sh b/test-django-rest-framework-xml/run.sh index 1deec49..f485891 100755 --- a/test-django-rest-framework-xml/run.sh +++ b/test-django-rest-framework-xml/run.sh @@ -1,20 +1,10 @@ #!/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 cd mysite -daphne -b 0.0.0.0 -p 8000 mysite.asgi:application -# ./manage.py runserver 0.0.0.0:8000 -#gunicorn movie_search.project.asgi:application -k uvicorn.workers.UvicornWorker \ No newline at end of file + +uv run daphne -b 0.0.0.0 -p 8000 mysite.asgi:application