fix: pin protobuf>=5.29.6,<6.0dev to prevent gencode/runtime version mismatch - #57
Conversation
|
Possible duplicate of #55 (that also has been lying around for too long....) |
…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. Signed-off-by: Akihiko Komada <aki1770@gmail.com>
ce25b89 to
2b5b9f9
Compare
|
You're right — this is effectively a duplicate of #55. @psch0rr's PR is earlier and takes the same approach (protobuf constrained in both pyproject.toml build requires and setup.cfg install_requires, per @erikbosch's suggestion in #54). Deferring to #55 and closing this one. Sorry for the slow reply. One small point, purely as input for your review of #55: this PR used a range ( |
Problem
Fixes #54. Installing
kuksa-clientviapip install kuksa-clientfails with:The root cause:
grpcio-tools==1.68.0requiresprotobuf>=5.26.1but does not pin a maximum.pipmay resolve to a protobuf version that is incompatible with the.proto-generated_pb2.pyfiles 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.pyfails.Fix
Add explicit
protobuf >= 5.29.6, < 6.0devconstraint to:setup.cfginstall_requires— ensures the runtime installs a compatible versionpyproject.tomlbuild-system.requires— ensures the build generates_pb2.pyfiles with the same protobuf versionThe
<6.0devupper bound follows the establishedgrpcio/grpcio-toolspattern of excluding the next major (which has breaking generated code changes). The lower bound matchesgrpcio-tools==1.68.0's resolvedprotobuf==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.