1 # Copyright 2015 gRPC authors.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 """Setup module for the GRPC Python package's optional health checking."""
20 _PACKAGE_PATH = os.path.realpath(os.path.dirname(__file__))
21 _README_PATH = os.path.join(_PACKAGE_PATH, 'README.rst')
23 # Ensure we're in the proper directory whether or not we're being used by pip.
24 os.chdir(os.path.dirname(os.path.abspath(__file__)))
26 # Break import-style to ensure we can actually find our local modules.
30 class _NoOpCommand(setuptools.Command):
36 def initialize_options(self):
39 def finalize_options(self):
47 'Development Status :: 5 - Production/Stable',
48 'Programming Language :: Python',
49 'Programming Language :: Python :: 2',
50 'Programming Language :: Python :: 2.7',
51 'Programming Language :: Python :: 3',
52 'Programming Language :: Python :: 3.4',
53 'Programming Language :: Python :: 3.5',
54 'Programming Language :: Python :: 3.6',
55 'License :: OSI Approved :: Apache Software License',
58 PACKAGE_DIRECTORIES = {
64 'grpcio>={version}'.format(version=grpc_version.VERSION),
68 import health_commands as _health_commands
69 # we are in the build environment, otherwise the above import fails
71 'grpcio-tools=={version}'.format(version=grpc_version.VERSION),)
73 # Run preprocess from the repository *before* doing any packaging!
74 'preprocess': _health_commands.Preprocess,
75 'build_package_protos': _health_commands.BuildPackageProtos,
80 # wire up commands to no-op not to break the external dependencies
81 'preprocess': _NoOpCommand,
82 'build_package_protos': _NoOpCommand,
86 name='grpcio-health-checking',
87 version=grpc_version.VERSION,
88 description='Standard Health Checking Service for gRPC',
89 long_description=open(_README_PATH, 'r').read(),
90 author='The gRPC Authors',
91 author_email='grpc-io@googlegroups.com',
92 url='https://grpc.io',
93 license='Apache License 2.0',
94 classifiers=CLASSIFIERS,
95 package_dir=PACKAGE_DIRECTORIES,
96 packages=setuptools.find_packages('.'),
97 install_requires=INSTALL_REQUIRES,
98 setup_requires=SETUP_REQUIRES,
99 cmdclass=COMMAND_CLASS)