Skip to content

chore: pin grpcio-tools to backwards-compatible version, bump min version of grpcio to 1.65.0 #272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Aug 4, 2025

Conversation

matthewmcneely
Copy link
Member

@matthewmcneely matthewmcneely commented Jul 29, 2025

Description

This PR resolves critical compatibility issues with grpcio-tools that were causing runtime errors for users with older grpcio versions. The changes ensure backward compatibility while providing a modern development experience.

The minimum version of grpcio is updated to 1.65.0 which is the last version that did not force runtime errors when detected grpcio versions were mismatched. grpcio versions older than ~1.60.0 fail to compile from source on modern systems (macOS with recent Xcode, newer Linux distributions) due to C++ compiler compatibility issues and outdated build configurations. This PR has generating grpc code targeting 1.65.5, which includes two security patches relevant to the 1.6x.x APIs:

  • CVE‑2024‑11407: Data corruption issue on servers using transmit zero copy
  • CVE‑2024‑7246: HPACK table poisoning by certain gRPC clients behind HTTP/2 proxies

This PR extends the flexibility that was added in #222 and #233.

The python script that generates protos (scripts/protogen.py) will fail if python 3.13 or higher is used (python 3.13 requires a later, incompatible grpcio)

Checklist

  • Code compiles correctly and linting passes locally
  • For all code changes, an entry added to the CHANGELOG.md file describing and linking to
    this PR
  • Tests added for new functionality, or regression tests for bug fixes added as applicable

@Copilot Copilot AI review requested due to automatic review settings July 29, 2025 18:11
@matthewmcneely matthewmcneely requested review from johnymontana and a team as code owners July 29, 2025 18:11
Copilot

This comment was marked as outdated.

@matthewmcneely matthewmcneely requested a review from Copilot July 29, 2025 19:21
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR resolves critical compatibility issues between grpcio and grpcio-tools by pinning grpcio-tools to version 1.65.x and bumping the minimum grpcio version to 1.65.0. This ensures backward compatibility while avoiding runtime errors from version mismatches, particularly for users with older grpcio installations.

  • Updated minimum grpcio version from 1.56.0 to 1.65.0 to avoid compilation issues on modern systems
  • Pinned grpcio-tools to 1.65.x (with conditional 1.66.2+ for Python 3.13+) to prevent compatibility conflicts
  • Added Python version checks to prevent generating incompatible protobufs with newer grpcio-tools versions

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pyproject.toml Updated grpcio minimum version and added conditional grpcio-tools pinning based on Python version
scripts/protogen.py Added Python 3.13+ compatibility check to prevent incompatible protobuf generation
pydgraph/proto/api_pb2_grpc.py Updated generated code to use warnings instead of errors for version mismatches
pydgraph/proto/api_pb2.py Regenerated protobuf code with older grpcio-tools version for compatibility
pydgraph/meta.py Bumped version to 24.3.0
README.md Added comprehensive documentation about grpcio version requirements and protobuf regeneration
CHANGELOG.md Added changelog entry for version 24.3.0
.github/workflows/ci-pydgraph-tests.yml Moved dgraph setup after protobuf verification and added Python version conditions

Co-authored-by: Copilot <[email protected]>
Copy link

@josephsw josephsw left a comment

Choose a reason for hiding this comment

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

Thanks for these changes!

@matthewmcneely
Copy link
Member Author

@mattjohnsonpint Can you please have a look?

Copy link
Member

@mattjohnsonpint mattjohnsonpint left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks! 🚀

@matthewmcneely matthewmcneely merged commit 05dd6b0 into main Aug 4, 2025
10 checks passed
@matthewmcneely matthewmcneely deleted the matthewmcneely/grpcio-tools-rework branch August 4, 2025 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants