Skip to content

build(test-grpc): Migrate to uv and pyproject.toml#29

Merged
ericapisani merged 1 commit into
mainfrom
PY-2456-test-grpc
May 21, 2026
Merged

build(test-grpc): Migrate to uv and pyproject.toml#29
ericapisani merged 1 commit into
mainfrom
PY-2456-test-grpc

Conversation

@ericapisani

Copy link
Copy Markdown
Member

Summary

  • 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
  • Remove legacy requirements.txt

Refs PY-2456

Test plan

  • Verify pyproject.toml includes all dependencies from the original requirements.txt
  • Verify shell scripts use uv run
  • Verify requirements.txt is removed

🤖 Generated with Claude Code

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 <noreply@anthropic.com>
@linear-code

linear-code Bot commented May 21, 2026

Copy link
Copy Markdown

PY-2456

Comment thread test-grpc/pyproject.toml
[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.

Comment thread test-grpc/run-server.sh
Comment on lines 1 to +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

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.

@ericapisani ericapisani merged commit 56ff265 into main May 21, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant