Skip to content

Commit

Permalink
feat: add minimum protoc version 3 check
Browse files Browse the repository at this point in the history
We don't know a specific minimum requirement, this is just eyeballing it.
Versions of protoc below 3 definitely won't match with the protobuf versioning scheme that reset the minor version at 3.0.0.
  • Loading branch information
tilsche committed Mar 1, 2023
1 parent 534378b commit 8ecb127
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ def make_protobuf_requirement(major: int, minor: int, patch: int) -> str:
"""
del patch # We don't even care

if major < 3:
raise RuntimeError(
"The installed protoc major version {major} is too old, "
"at least version 3 is required."
)

# We must subtract one because bisect gives the insertion point after...
py_major = protobuf_version_mapping[
bisect_right(protobuf_version_mapping, minor, key=itemgetter(0)) - 1
Expand Down

0 comments on commit 8ecb127

Please sign in to comment.