|
| 1 | +# Copyright 2018 The gRPC Authors |
| 2 | +# |
| 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 |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 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 status mapping.""" |
| 15 | + |
| 16 | +import os |
| 17 | + |
| 18 | +import setuptools |
| 19 | + |
| 20 | +# Ensure we're in the proper directory whether or not we're being used by pip. |
| 21 | +os.chdir(os.path.dirname(os.path.abspath(__file__))) |
| 22 | + |
| 23 | +# Break import-style to ensure we can actually find our local modules. |
| 24 | +import grpc_version |
| 25 | + |
| 26 | + |
| 27 | +class _NoOpCommand(setuptools.Command): |
| 28 | + """No-op command.""" |
| 29 | + |
| 30 | + description = '' |
| 31 | + user_options = [] |
| 32 | + |
| 33 | + def initialize_options(self): |
| 34 | + pass |
| 35 | + |
| 36 | + def finalize_options(self): |
| 37 | + pass |
| 38 | + |
| 39 | + def run(self): |
| 40 | + pass |
| 41 | + |
| 42 | + |
| 43 | +CLASSIFIERS = [ |
| 44 | + 'Development Status :: 5 - Production/Stable', |
| 45 | + 'Programming Language :: Python', |
| 46 | + 'Programming Language :: Python :: 2', |
| 47 | + 'Programming Language :: Python :: 2.7', |
| 48 | + 'Programming Language :: Python :: 3', |
| 49 | + 'Programming Language :: Python :: 3.4', |
| 50 | + 'Programming Language :: Python :: 3.5', |
| 51 | + 'Programming Language :: Python :: 3.6', |
| 52 | + 'Programming Language :: Python :: 3.7', |
| 53 | + 'License :: OSI Approved :: Apache Software License', |
| 54 | +] |
| 55 | + |
| 56 | +PACKAGE_DIRECTORIES = { |
| 57 | + '': '.', |
| 58 | +} |
| 59 | + |
| 60 | +INSTALL_REQUIRES = ( |
| 61 | + 'protobuf>=3.6.0', |
| 62 | + 'grpcio>={version}'.format(version=grpc_version.VERSION), |
| 63 | + 'googleapis-common-protos>=1.5.5', |
| 64 | +) |
| 65 | + |
| 66 | +SETUP_REQUIRES = () |
| 67 | +COMMAND_CLASS = { |
| 68 | + # wire up commands to no-op not to break the external dependencies |
| 69 | + 'preprocess': _NoOpCommand, |
| 70 | + 'build_package_protos': _NoOpCommand, |
| 71 | +} |
| 72 | + |
| 73 | +setuptools.setup( |
| 74 | + name='grpcio-status', |
| 75 | + version=grpc_version.VERSION, |
| 76 | + description='Status proto mapping for gRPC', |
| 77 | + author='The gRPC Authors', |
| 78 | + |
| 79 | + url='https://grpc.io', |
| 80 | + license='Apache License 2.0', |
| 81 | + classifiers=CLASSIFIERS, |
| 82 | + package_dir=PACKAGE_DIRECTORIES, |
| 83 | + packages=setuptools.find_packages('.'), |
| 84 | + install_requires=INSTALL_REQUIRES, |
| 85 | + setup_requires=SETUP_REQUIRES, |
| 86 | + cmdclass=COMMAND_CLASS) |
0 commit comments