diff --git a/setup.py b/setup.py index d4d61811..5eb2192f 100755 --- a/setup.py +++ b/setup.py @@ -42,11 +42,11 @@ def _find_protoc() -> str | None: def _get_protoc_version(protoc: str) -> tuple[int, int, int]: protoc_version_string = str(subprocess.check_output([protoc, "--version"])) version_search = re.search( - r"((?P(0|[1-9]\d*))\.(?P(0|[1-9]\d*))(\.(?P(0|[1-9]\d*)))?)", + r"(((?P(0|[1-9]\d*))\.)?(?P(0|[1-9]\d*))\.(?P(0|[1-9]\d*)))", protoc_version_string, ) - return tuple(int(version_search.group(g)) if version_search.group(g) is not None else 0 for g in ("major", "minor", "patch")) # type: ignore + return tuple(int(version_search.group(g)) if version_search.group(g) is not None else 3 for g in ("major", "minor", "patch")) # type: ignore _executable: str | None _version: tuple[int, int, int] | None @@ -116,6 +116,7 @@ def make_protobuf_requirement(major: int, minor: int, patch: int) -> str: protobuf_version_mapping = ( (3, 0), (4, 21), + (5, 26) ) # We must subtract one because bisect gives the insertion point after...