Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions test-grpc/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[project]
name = "test-grpc"
version = "0"
requires-python = ">=3.12"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The Python version in .python-version (3.10) conflicts with the requires-python constraint (>=3.12) in pyproject.toml, causing uv run to fail.
Severity: HIGH

Suggested Fix

Align the Python versions. Either update the .python-version file to a version compatible with the >=3.12 constraint, or adjust the requires-python setting in pyproject.toml to ">=3.10" if the code supports it.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: test-grpc/pyproject.toml#L4

Potential issue: The `test-grpc` directory contains a `.python-version` file that
specifies Python version `3.10`. However, the `pyproject.toml` file introduced in this
pull request requires Python version `>=3.12`. When scripts like `run-server.sh` are
executed using `uv run`, `uv` detects this version conflict and exits with an error,
preventing the scripts from running.

Did we get this right? 👍 / 👎 to inform future reviews.


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 }
6 changes: 0 additions & 6 deletions test-grpc/requirements.txt

This file was deleted.

16 changes: 5 additions & 11 deletions test-grpc/run-client-aysnc.sh
Original file line number Diff line number Diff line change
@@ -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
uv run python client-async.py
16 changes: 5 additions & 11 deletions test-grpc/run-client.sh
Original file line number Diff line number Diff line change
@@ -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
uv run python client.py
16 changes: 5 additions & 11 deletions test-grpc/run-server-async.sh
Original file line number Diff line number Diff line change
@@ -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
uv run python server-async.py
16 changes: 5 additions & 11 deletions test-grpc/run-server.sh
Original file line number Diff line number Diff line change
@@ -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
uv run python server.py
Comment on lines 1 to +8

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The compile-service.sh script was not updated to use uv and fails because it can no longer install its dependencies.
Severity: HIGH

Suggested Fix

Update compile-service.sh to use uv run for executing the protobuf compiler, similar to how run-server.sh was updated. This ensures the necessary dependencies, like grpcio-tools, are available during execution.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: test-grpc/run-server.sh#L1-L8

Potential issue: The `compile-service.sh` script was not updated to use `uv` for
dependency management. It still attempts to create a virtual environment and run `python
-m grpc_tools.protoc`. Since the `requirements.txt` file was removed and dependencies
are now managed by `uv` via `pyproject.toml`, the virtual environment created by the
script is empty. This causes the script to fail with a `No module named
grpc_tools.protoc` error, rendering it unusable.

Did we get this right? 👍 / 👎 to inform future reviews.

Loading