From 9def429f5c465525b607cd1e249269d50f40b707 Mon Sep 17 00:00:00 2001 From: Erica Pisani Date: Thu, 21 May 2026 16:23:23 -0400 Subject: [PATCH] build(test-fastapi-root-path): 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-2451 Co-Authored-By: Claude Opus 4.6 --- test-fastapi-root-path/pyproject.toml | 16 ++++++++++++++++ test-fastapi-root-path/requirements.txt | 10 ---------- test-fastapi-root-path/run.sh | 14 ++++---------- 3 files changed, 20 insertions(+), 20 deletions(-) create mode 100644 test-fastapi-root-path/pyproject.toml delete mode 100644 test-fastapi-root-path/requirements.txt diff --git a/test-fastapi-root-path/pyproject.toml b/test-fastapi-root-path/pyproject.toml new file mode 100644 index 0000000..0f8847a --- /dev/null +++ b/test-fastapi-root-path/pyproject.toml @@ -0,0 +1,16 @@ +[project] +name = "test-fastapi-root-path" +version = "0" +requires-python = ">=3.12" + +dependencies = [ + "black>=25.1.0", + "fastapi>=0.115.11", + "ipdb>=0.13.13", + "requests>=2.32.3", + "sentry-sdk[fastapi]", + "uvicorn>=0.34.0", +] + +[tool.uv.sources] +sentry-sdk = { path = "../../sentry-python", editable = true } diff --git a/test-fastapi-root-path/requirements.txt b/test-fastapi-root-path/requirements.txt deleted file mode 100644 index c571613..0000000 --- a/test-fastapi-root-path/requirements.txt +++ /dev/null @@ -1,10 +0,0 @@ -fastapi -uvicorn - -requests -black -ipdb - -# Sentry --e ../../../code/sentry-python/ # local dev version of sentry python sdk. -# sentry-sdk==1.11.0 # production version of sentry python sdk from PyPI. diff --git a/test-fastapi-root-path/run.sh b/test-fastapi-root-path/run.sh index 7e13e9e..6460224 100755 --- a/test-fastapi-root-path/run.sh +++ b/test-fastapi-root-path/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