From a4d8d90ddd6fa7fb4bc2e5d9a1757d3908b5cd53 Mon Sep 17 00:00:00 2001 From: Erica Pisani Date: Thu, 21 May 2026 16:26:06 -0400 Subject: [PATCH] build(test-grpc): Migrate to uv and pyproject.toml Replace pip/requirements.txt with uv/pyproject.toml for dependency management. Update all run scripts to use uv run instead of manual venv creation and pip install. Refs PY-2456 Co-Authored-By: Claude Opus 4.6 --- test-grpc/pyproject.toml | 14 ++++++++++++++ test-grpc/requirements.txt | 6 ------ test-grpc/run-client-aysnc.sh | 16 +++++----------- test-grpc/run-client.sh | 16 +++++----------- test-grpc/run-server-async.sh | 16 +++++----------- test-grpc/run-server.sh | 16 +++++----------- 6 files changed, 34 insertions(+), 50 deletions(-) create mode 100644 test-grpc/pyproject.toml delete mode 100644 test-grpc/requirements.txt diff --git a/test-grpc/pyproject.toml b/test-grpc/pyproject.toml new file mode 100644 index 0000000..e657158 --- /dev/null +++ b/test-grpc/pyproject.toml @@ -0,0 +1,14 @@ +[project] +name = "test-grpc" +version = "0" +requires-python = ">=3.12" + +dependencies = [ + "grpcio>=1.71.0", + "grpcio-tools>=1.71.0", + "ipdb>=0.13.13", + "sentry-sdk[grpcio]", +] + +[tool.uv.sources] +sentry-sdk = { path = "../../sentry-python", editable = true } diff --git a/test-grpc/requirements.txt b/test-grpc/requirements.txt deleted file mode 100644 index 1d936e1..0000000 --- a/test-grpc/requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ --e ../../../code/sentry-python - -grpcio -grpcio-tools # includes `protoc` compiler - -ipdb \ No newline at end of file diff --git a/test-grpc/run-client-aysnc.sh b/test-grpc/run-client-aysnc.sh index ee01443..8204463 100755 --- a/test-grpc/run-client-aysnc.sh +++ b/test-grpc/run-client-aysnc.sh @@ -1,14 +1,8 @@ #!/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 - - -python client-async.py \ No newline at end of file +uv run python client-async.py diff --git a/test-grpc/run-client.sh b/test-grpc/run-client.sh index fa0cb3b..11883c9 100755 --- a/test-grpc/run-client.sh +++ b/test-grpc/run-client.sh @@ -1,14 +1,8 @@ #!/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 - - -python client.py \ No newline at end of file +uv run python client.py diff --git a/test-grpc/run-server-async.sh b/test-grpc/run-server-async.sh index c4a8747..382868c 100755 --- a/test-grpc/run-server-async.sh +++ b/test-grpc/run-server-async.sh @@ -1,14 +1,8 @@ #!/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 - - -python server-async.py \ No newline at end of file +uv run python server-async.py diff --git a/test-grpc/run-server.sh b/test-grpc/run-server.sh index 2faf8d9..e5a8f7e 100755 --- a/test-grpc/run-server.sh +++ b/test-grpc/run-server.sh @@ -1,14 +1,8 @@ #!/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 - - -python server.py \ No newline at end of file +uv run python server.py