Merge pull request #13431 from mehrdada/fix-setup-py-trigger-for-health-reflection

Alter build criterion for health/reflection packages
pull/12942/head
Mehrdad Afshari 7 years ago committed by GitHub
commit d21365813f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 18
      src/python/grpcio_health_checking/setup.py
  2. 18
      src/python/grpcio_reflection/setup.py

@ -60,17 +60,8 @@ INSTALL_REQUIRES = ('protobuf>=3.3.0',
'grpcio>={version}'.format(version=grpc_version.VERSION),) 'grpcio>={version}'.format(version=grpc_version.VERSION),)
try: try:
# ensure we can load the _pb2_grpc module:
from grpc_health.v1 import health_pb2_grpc as _pb2_grpc
# if we can find the _pb2_grpc module, the package has already been built.
SETUP_REQUIRES = ()
COMMAND_CLASS = {
# wire up commands to no-op not to break the external dependencies
'preprocess': _NoOpCommand,
'build_package_protos': _NoOpCommand,
}
except ImportError: # we are in the build environment
import health_commands as _health_commands import health_commands as _health_commands
# we are in the build environment, otherwise the above import fails
SETUP_REQUIRES = ( SETUP_REQUIRES = (
'grpcio-tools=={version}'.format(version=grpc_version.VERSION),) 'grpcio-tools=={version}'.format(version=grpc_version.VERSION),)
COMMAND_CLASS = { COMMAND_CLASS = {
@ -78,6 +69,13 @@ except ImportError: # we are in the build environment
'preprocess': _health_commands.CopyProtoModules, 'preprocess': _health_commands.CopyProtoModules,
'build_package_protos': _health_commands.BuildPackageProtos, 'build_package_protos': _health_commands.BuildPackageProtos,
} }
except ImportError:
SETUP_REQUIRES = ()
COMMAND_CLASS = {
# wire up commands to no-op not to break the external dependencies
'preprocess': _NoOpCommand,
'build_package_protos': _NoOpCommand,
}
setuptools.setup( setuptools.setup(
name='grpcio-health-checking', name='grpcio-health-checking',

@ -61,17 +61,8 @@ INSTALL_REQUIRES = ('protobuf>=3.3.0',
'grpcio>={version}'.format(version=grpc_version.VERSION),) 'grpcio>={version}'.format(version=grpc_version.VERSION),)
try: try:
# ensure we can load the _pb2_grpc module:
from grpc_reflection.v1alpha import reflection_pb2_grpc as _pb2_grpc
# if we can find the _pb2_grpc module, the package has already been built.
SETUP_REQUIRES = ()
COMMAND_CLASS = {
# wire up commands to no-op not to break the external dependencies
'preprocess': _NoOpCommand,
'build_package_protos': _NoOpCommand,
}
except ImportError: # we are in the build environment
import reflection_commands as _reflection_commands import reflection_commands as _reflection_commands
# we are in the build environment, otherwise the above import fails
SETUP_REQUIRES = ( SETUP_REQUIRES = (
'grpcio-tools=={version}'.format(version=grpc_version.VERSION),) 'grpcio-tools=={version}'.format(version=grpc_version.VERSION),)
COMMAND_CLASS = { COMMAND_CLASS = {
@ -79,6 +70,13 @@ except ImportError: # we are in the build environment
'preprocess': _reflection_commands.CopyProtoModules, 'preprocess': _reflection_commands.CopyProtoModules,
'build_package_protos': _reflection_commands.BuildPackageProtos, 'build_package_protos': _reflection_commands.BuildPackageProtos,
} }
except ImportError:
SETUP_REQUIRES = ()
COMMAND_CLASS = {
# wire up commands to no-op not to break the external dependencies
'preprocess': _NoOpCommand,
'build_package_protos': _NoOpCommand,
}
setuptools.setup( setuptools.setup(
name='grpcio-reflection', name='grpcio-reflection',

Loading…
Cancel
Save