14 """Provides distutils command classes for the GRPC Python setup process."""
21 ROOT_DIR = os.path.abspath(os.path.dirname(os.path.abspath(__file__)))
22 REFLECTION_PROTO = os.path.join(
23 ROOT_DIR,
'../../proto/grpc/reflection/v1alpha/reflection.proto')
24 LICENSE = os.path.join(ROOT_DIR,
'../../../LICENSE')
28 """Command to copy proto modules from grpc/src/proto and LICENSE from
41 if os.path.isfile(REFLECTION_PROTO):
44 os.path.join(ROOT_DIR,
45 'grpc_reflection/v1alpha/reflection.proto'))
46 if os.path.isfile(LICENSE):
47 shutil.copyfile(LICENSE, os.path.join(ROOT_DIR,
'LICENSE'))
51 """Command to generate project *_pb2.py modules from proto files."""
53 description =
'build grpc protobuf modules'
67 from grpc_tools
import command
68 command.build_package_protos(self.distribution.package_dir[
''])