From c99d423c15474bcc8a93d4954c09b8a399c0a9f7 Mon Sep 17 00:00:00 2001 From: Erica Pisani Date: Thu, 21 May 2026 16:21:34 -0400 Subject: [PATCH] build(test-fastapi-background-tasks): 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-2448 Co-Authored-By: Claude Opus 4.6 --- test-fastapi-background-tasks/pyproject.toml | 14 ++++++++++++++ test-fastapi-background-tasks/requirements.txt | 8 -------- test-fastapi-background-tasks/run.sh | 14 ++++---------- 3 files changed, 18 insertions(+), 18 deletions(-) create mode 100644 test-fastapi-background-tasks/pyproject.toml delete mode 100644 test-fastapi-background-tasks/requirements.txt diff --git a/test-fastapi-background-tasks/pyproject.toml b/test-fastapi-background-tasks/pyproject.toml new file mode 100644 index 0000000..62c7826 --- /dev/null +++ b/test-fastapi-background-tasks/pyproject.toml @@ -0,0 +1,14 @@ +[project] +name = "test-fastapi-background-tasks" +version = "0" +requires-python = ">=3.12" + +dependencies = [ + "fastapi>=0.115.11", + "ipdb>=0.13.13", + "sentry-sdk[fastapi]", + "uvicorn>=0.34.0", +] + +[tool.uv.sources] +sentry-sdk = { path = "../../sentry-python", editable = true } diff --git a/test-fastapi-background-tasks/requirements.txt b/test-fastapi-background-tasks/requirements.txt deleted file mode 100644 index ac7ad68..0000000 --- a/test-fastapi-background-tasks/requirements.txt +++ /dev/null @@ -1,8 +0,0 @@ -fastapi -uvicorn - -ipdb - -# Sentry --e ../../../code/sentry-python/ # local dev version of sentry python sdk. -# sentry-sdk==2.11.0 # production version of sentry python sdk from PyPI.` \ No newline at end of file diff --git a/test-fastapi-background-tasks/run.sh b/test-fastapi-background-tasks/run.sh index 7e13e9e..6460224 100755 --- a/test-fastapi-background-tasks/run.sh +++ b/test-fastapi-background-tasks/run.sh @@ -1,15 +1,9 @@ #!/usr/bin/env bash - set -euo pipefail - reset -python -m venv .venv -source .venv/bin/activate - -pip install -r requirements.txt - -# uvicorn main:app --port 5000 --reload --root-path /api/v1 & -uvicorn main:app --port 5000 --reload +if ! command -v uv &> /dev/null; then + curl -LsSf https://astral.sh/uv/install.sh | sh +fi -#nginx -c "$(pwd)/nginx.conf" +uv run uvicorn main:app --port 5000 --reload