Merge pull request #13233 from mehrdada/fix-grpcio-reflection-health-packaging

Fix grpcio_{reflection,health_checking} packaging
pull/13415/merge
Mehrdad Afshari 7 years ago committed by GitHub
commit f6d4008c5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/python/grpcio_health_checking/MANIFEST.in
  2. 47
      src/python/grpcio_health_checking/setup.py
  3. 3
      src/python/grpcio_reflection/MANIFEST.in
  4. 47
      src/python/grpcio_reflection/setup.py

@ -1,4 +1,3 @@
include grpc_version.py
include health_commands.py
graft grpc_health
recursive-include grpc_health *.py
global-exclude *.pyc

@ -20,10 +20,26 @@ import setuptools
# Ensure we're in the proper directory whether or not we're being used by pip.
os.chdir(os.path.dirname(os.path.abspath(__file__)))
# Break import-style to ensure we can actually find our commands module.
import health_commands
# Break import-style to ensure we can actually find our local modules.
import grpc_version
class _NoOpCommand(setuptools.Command):
"""No-op command."""
description = ''
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
pass
CLASSIFIERS = [
'Development Status :: 5 - Production/Stable',
'Programming Language :: Python',
@ -40,17 +56,28 @@ PACKAGE_DIRECTORIES = {
'': '.',
}
SETUP_REQUIRES = (
'grpcio-tools>={version}'.format(version=grpc_version.VERSION),)
INSTALL_REQUIRES = ('protobuf>=3.3.0',
'grpcio>={version}'.format(version=grpc_version.VERSION),)
COMMAND_CLASS = {
# Run preprocess from the repository *before* doing any packaging!
'preprocess': health_commands.CopyProtoModules,
'build_package_protos': health_commands.BuildPackageProtos,
}
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
SETUP_REQUIRES = (
'grpcio-tools=={version}'.format(version=grpc_version.VERSION),)
COMMAND_CLASS = {
# Run preprocess from the repository *before* doing any packaging!
'preprocess': _health_commands.CopyProtoModules,
'build_package_protos': _health_commands.BuildPackageProtos,
}
setuptools.setup(
name='grpcio-health-checking',

@ -1,4 +1,3 @@
include grpc_version.py
include reflection_commands.py
graft grpc_reflection
recursive-include grpc_reflection *.py
global-exclude *.pyc

@ -21,10 +21,26 @@ import setuptools
# Ensure we're in the proper directory whether or not we're being used by pip.
os.chdir(os.path.dirname(os.path.abspath(__file__)))
# Break import-style to ensure we can actually find our commands module.
import reflection_commands
# Break import-style to ensure we can actually find our local modules.
import grpc_version
class _NoOpCommand(setuptools.Command):
"""No-op command."""
description = ''
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
pass
CLASSIFIERS = [
'Development Status :: 5 - Production/Stable',
'Programming Language :: Python',
@ -41,17 +57,28 @@ PACKAGE_DIRECTORIES = {
'': '.',
}
SETUP_REQUIRES = (
'grpcio-tools>={version}'.format(version=grpc_version.VERSION),)
INSTALL_REQUIRES = ('protobuf>=3.3.0',
'grpcio>={version}'.format(version=grpc_version.VERSION),)
COMMAND_CLASS = {
# Run preprocess from the repository *before* doing any packaging!
'preprocess': reflection_commands.CopyProtoModules,
'build_package_protos': reflection_commands.BuildPackageProtos,
}
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
SETUP_REQUIRES = (
'grpcio-tools=={version}'.format(version=grpc_version.VERSION),)
COMMAND_CLASS = {
# Run preprocess from the repository *before* doing any packaging!
'preprocess': _reflection_commands.CopyProtoModules,
'build_package_protos': _reflection_commands.BuildPackageProtos,
}
setuptools.setup(
name='grpcio-reflection',

Loading…
Cancel
Save