Skip to content

fix: pin protobuf>=5.29.6,<6.0dev to prevent gencode/runtime version mismatch#57

Open
aki1770-del wants to merge 1 commit intoeclipse-kuksa:mainfrom
aki1770-del:fix/protobuf-version-collision-54
Open

fix: pin protobuf>=5.29.6,<6.0dev to prevent gencode/runtime version mismatch#57
aki1770-del wants to merge 1 commit intoeclipse-kuksa:mainfrom
aki1770-del:fix/protobuf-version-collision-54

Conversation

@aki1770-del
Copy link
Copy Markdown

Problem

Fixes #54. Installing kuksa-client via pip install kuksa-client fails with:

RuntimeWarning: Detected incompatible Protobuf Gencode/Runtime versions

The root cause: grpcio-tools==1.68.0 requires protobuf>=5.26.1 but does not pin a maximum. pip may resolve to a protobuf version that is incompatible with the .proto-generated _pb2.py files included in the package. In the reported case, protobuf 5.27.3 was installed at build time and 5.29.x at runtime — the version check in _pb2.py fails.

Fix

Add explicit protobuf >= 5.29.6, < 6.0dev constraint to:

  • setup.cfg install_requires — ensures the runtime installs a compatible version
  • pyproject.toml build-system.requires — ensures the build generates _pb2.py files with the same protobuf version

The <6.0dev upper bound follows the established grpcio/grpcio-tools pattern of excluding the next major (which has breaking generated code changes). The lower bound matches grpcio-tools==1.68.0's resolved protobuf==5.29.6.

No API changes

This is a dependency metadata fix only. No Python source files change.


AI-assisted — authored with Claude, reviewed by Komada.

…mismatch

Fixes eclipse-kuksa#54. grpcio-tools==1.68.0 resolves to protobuf 5.29.6. Without an
explicit runtime constraint, pip may install a mismatched protobuf version
causing "Detected incompatible Protobuf Gencode/Runtime versions" on import.

Add protobuf>=5.29.6,<6.0dev to both setup.cfg install_requires (runtime)
and pyproject.toml build-system requires (build-time), ensuring the proto
files are generated and loaded with a compatible protobuf version.

Co-Authored-By: Claude and aki1770-del <aki1770@gmail.com>
@SebastianSchildt
Copy link
Copy Markdown
Contributor

Possible duplicate of #55 (that also has been lying around for too long....)

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.

Collision with protobuf runtime and provided proto files after pip installation - Detected incompatible Protobuf Gencode/Runtime versions

2 participants