Skip to content

Commit 088df22

Browse files
Raise an error if attempting to generate protobufs using python 3.13
1 parent 89ae89a commit 088df22

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

scripts/protogen.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,18 @@
44
"""Runs protoc with the gRPC plugin to generate messages and gRPC stubs."""
55

66
import os
7+
import sys
78

89
from grpc_tools import protoc
910

11+
# Check Python version compatibility
12+
if sys.version_info >= (3, 13):
13+
print("ERROR: Python 3.13+ requires grpcio-tools >=1.66.2, which generates")
14+
print("protobufs that are incompatible with older grpcio-tools versions.")
15+
print("Please use Python 3.12 or lower to generate compatible protobufs.")
16+
print("Exiting without generating protobufs.")
17+
sys.exit(1)
18+
1019
dirpath = os.path.dirname(os.path.realpath(__file__))
1120
protopath = os.path.realpath(os.path.join(dirpath, "../pydgraph/proto"))
1221

0 commit comments

Comments
 (0)