We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a686f55 commit ac404b3Copy full SHA for ac404b3
setup.py
@@ -4,20 +4,22 @@
4
5
import os.path
6
import subprocess
7
+import shutil
8
-PROTOC_BIN = "/usr/bin/protoc"
9
+PROTOC_EXEC = "protoc"
10
11
CURRENT_DIR = os.path.abspath( os.path.dirname( __file__ ) )
12
13
class ProtobufBuilder(_build):
14
15
def run(self):
16
# check if protobuf is installed
- if not os.path.isfile(PROTOC_BIN):
17
+ exec_path = shutil.which(PROTOC_EXEC)
18
+ if exec_path is None:
19
raise Exception("You should install protobuf compiler")
20
21
print("Building protobuf file")
- subprocess.run([PROTOC_BIN,
22
+ subprocess.run([exec_path,
23
"--proto_path=" + CURRENT_DIR,
24
"--python_out=" + CURRENT_DIR + "/gpapi/",
25
CURRENT_DIR + "/googleplay.proto"])
0 commit comments