diff options
author | jiangtaoli2016 <jiangtao@google.com> | 2017-09-14 16:39:34 -0700 |
---|---|---|
committer | jiangtaoli2016 <jiangtao@google.com> | 2017-09-14 16:39:34 -0700 |
commit | 1500cd6e8c0922048288bff1e4a3da75f610506c (patch) | |
tree | 4fd6d1905dd6f7b07899fc13fcd6e41b32f44bdf /src/python | |
parent | f68978c41f13197171325d944f971db7d9d85a54 (diff) | |
parent | c3aba91be94d336a27f945a644233bc244f22e2b (diff) |
Merge branch 'master' of https://github.com/grpc/grpc into tsi_exec_ctx
Diffstat (limited to 'src/python')
-rw-r--r-- | src/python/grpcio_tests/commands.py | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/src/python/grpcio_tests/commands.py b/src/python/grpcio_tests/commands.py index 162200112a..93f84572b7 100644 --- a/src/python/grpcio_tests/commands.py +++ b/src/python/grpcio_tests/commands.py @@ -67,55 +67,6 @@ class GatherProto(setuptools.Command): open(path, 'a').close() -class BuildProtoModules(setuptools.Command): - """Command to generate project *_pb2.py modules from proto files.""" - - description = 'build protobuf modules' - user_options = [ - ('include=', None, 'path patterns to include in protobuf generation'), - ('exclude=', None, 'path patterns to exclude from protobuf generation') - ] - - def initialize_options(self): - self.exclude = None - self.include = r'.*\.proto$' - - def finalize_options(self): - pass - - def run(self): - import grpc_tools.protoc as protoc - - include_regex = re.compile(self.include) - exclude_regex = re.compile(self.exclude) if self.exclude else None - paths = [] - for walk_root, directories, filenames in os.walk(PROTO_STEM): - for filename in filenames: - path = os.path.join(walk_root, filename) - if include_regex.match(path) and not ( - exclude_regex and exclude_regex.match(path)): - paths.append(path) - - # TODO(kpayson): It would be nice to do this in a batch command, - # but we currently have name conflicts in src/proto - for path in paths: - command = [ - 'grpc_tools.protoc', - '-I {}'.format(PROTO_STEM), - '--python_out={}'.format(PROTO_STEM), - '--grpc_python_out={}'.format(PROTO_STEM), - ] + [path] - if protoc.main(command) != 0: - sys.stderr.write( - 'warning: Command:\n{}\nFailed'.format(command)) - - # Generated proto directories dont include __init__.py, but - # these are needed for python package resolution - for walk_root, _, _ in os.walk(PROTO_STEM): - path = os.path.join(walk_root, '__init__.py') - open(path, 'a').close() - - class BuildPy(build_py.build_py): """Custom project build command.""" |