From 57adfddd03a014f432378f09f09d8f80cce5df19 Mon Sep 17 00:00:00 2001 From: Erica Pisani Date: Thu, 21 May 2026 16:22:06 -0400 Subject: [PATCH] build(test-fastapi-distributed-tracing): Migrate to uv and pyproject.toml Replace pip/requirements.txt with uv/pyproject.toml for dependency management. Update run1.sh and run2.sh to use uv run instead of manual venv creation and pip install. Refs PY-2449 Co-Authored-By: Claude Opus 4.6 --- test-fastapi-distributed-tracing/pyproject.toml | 16 ++++++++++++++++ .../requirements.txt | 10 ---------- test-fastapi-distributed-tracing/run1.sh | 14 ++++---------- test-fastapi-distributed-tracing/run2.sh | 14 ++++---------- 4 files changed, 24 insertions(+), 30 deletions(-) create mode 100644 test-fastapi-distributed-tracing/pyproject.toml delete mode 100644 test-fastapi-distributed-tracing/requirements.txt diff --git a/test-fastapi-distributed-tracing/pyproject.toml b/test-fastapi-distributed-tracing/pyproject.toml new file mode 100644 index 0000000..570bacb --- /dev/null +++ b/test-fastapi-distributed-tracing/pyproject.toml @@ -0,0 +1,16 @@ +[project] +name = "test-fastapi-distributed-tracing" +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-distributed-tracing/requirements.txt b/test-fastapi-distributed-tracing/requirements.txt deleted file mode 100644 index c571613..0000000 --- a/test-fastapi-distributed-tracing/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-distributed-tracing/run1.sh b/test-fastapi-distributed-tracing/run1.sh index 1c72cbc..e0e5f79 100755 --- a/test-fastapi-distributed-tracing/run1.sh +++ b/test-fastapi-distributed-tracing/run1.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 main1:app --port 5001 --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 main1:app --port 5001 --reload diff --git a/test-fastapi-distributed-tracing/run2.sh b/test-fastapi-distributed-tracing/run2.sh index 762e6fe..6d647a0 100755 --- a/test-fastapi-distributed-tracing/run2.sh +++ b/test-fastapi-distributed-tracing/run2.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 main2:app --port 5002 --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 main2:app --port 5002 --reload