Repository: beam
Updated Branches:
  refs/heads/master 1039f5b96 -> 07b6b0115


Avoids generating proto files for Windows if grpcio-tools is not installed.


Project: http://git-wip-us.apache.org/repos/asf/beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/f4724397
Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/f4724397
Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/f4724397

Branch: refs/heads/master
Commit: f4724397c54b31fe67517f92cab2b238aed8d527
Parents: 1039f5b
Author: chamik...@google.com <chamik...@google.com>
Authored: Tue Oct 17 18:46:40 2017 -0700
Committer: chamik...@google.com <chamik...@google.com>
Committed: Thu Oct 19 15:29:16 2017 -0700

----------------------------------------------------------------------
 sdks/python/gen_protos.py | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/beam/blob/f4724397/sdks/python/gen_protos.py
----------------------------------------------------------------------
diff --git a/sdks/python/gen_protos.py b/sdks/python/gen_protos.py
index 59d6cb7..c7bf55f 100644
--- a/sdks/python/gen_protos.py
+++ b/sdks/python/gen_protos.py
@@ -22,6 +22,7 @@ import logging
 import multiprocessing
 import os
 import pkg_resources
+import platform
 import shutil
 import subprocess
 import sys
@@ -76,6 +77,13 @@ def generate_proto_files(force=False):
     try:
       from grpc_tools import protoc
     except ImportError:
+      if platform.system() == 'Windows':
+        # For Windows, grpcio-tools has to be installed manually.
+        raise RuntimeError(
+            'Cannot generate protos for Windows since grpcio-tools package is '
+            'not installed. Please install this package manually '
+            'using \'pip install grpcio-tools\'.')
+
       # Use a subprocess to avoid messing with this process' path and imports.
       # Note that this requires a separate module from setup.py for Windows:
       # https://docs.python.org/2/library/multiprocessing.html#windows

Reply via email to