Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 1 | # Copyright 2016 gRPC authors. |
Masood Malekghassemi | aff6936 | 2016-09-21 15:10:36 -0700 | [diff] [blame] | 2 | # |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 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 |
Masood Malekghassemi | aff6936 | 2016-09-21 15:10:36 -0700 | [diff] [blame] | 6 | # |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
Masood Malekghassemi | aff6936 | 2016-09-21 15:10:36 -0700 | [diff] [blame] | 8 | # |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 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. |
Masood Malekghassemi | aff6936 | 2016-09-21 15:10:36 -0700 | [diff] [blame] | 14 | """Setup module for the GRPC Python package's optional reflection.""" |
| 15 | |
| 16 | import os |
| 17 | import sys |
| 18 | |
| 19 | import setuptools |
| 20 | |
| 21 | # Ensure we're in the proper directory whether or not we're being used by pip. |
| 22 | os.chdir(os.path.dirname(os.path.abspath(__file__))) |
| 23 | |
| 24 | # Break import-style to ensure we can actually find our commands module. |
| 25 | import reflection_commands |
| 26 | import grpc_version |
| 27 | |
Ken Payson | 2fa5f2f | 2017-02-06 10:27:09 -0800 | [diff] [blame] | 28 | PACKAGE_DIRECTORIES = { |
| 29 | '': '.', |
| 30 | } |
Masood Malekghassemi | aff6936 | 2016-09-21 15:10:36 -0700 | [diff] [blame] | 31 | |
| 32 | SETUP_REQUIRES = ( |
Masood Malekghassemi | cc79370 | 2017-01-13 19:20:10 -0800 | [diff] [blame] | 33 | 'grpcio-tools>={version}'.format(version=grpc_version.VERSION),) |
Masood Malekghassemi | aff6936 | 2016-09-21 15:10:36 -0700 | [diff] [blame] | 34 | |
Ken Payson | 0290906 | 2017-05-04 12:33:58 -0700 | [diff] [blame] | 35 | INSTALL_REQUIRES = ('protobuf>=3.3.0', |
Ken Payson | 2fa5f2f | 2017-02-06 10:27:09 -0800 | [diff] [blame] | 36 | 'grpcio>={version}'.format(version=grpc_version.VERSION),) |
Masood Malekghassemi | aff6936 | 2016-09-21 15:10:36 -0700 | [diff] [blame] | 37 | |
| 38 | COMMAND_CLASS = { |
| 39 | # Run preprocess from the repository *before* doing any packaging! |
| 40 | 'preprocess': reflection_commands.CopyProtoModules, |
| 41 | 'build_package_protos': reflection_commands.BuildPackageProtos, |
| 42 | } |
| 43 | |
| 44 | setuptools.setup( |
| 45 | name='grpcio-reflection', |
| 46 | version=grpc_version.VERSION, |
Jan Tattermusch | 4d5c310 | 2017-06-07 10:23:56 +0200 | [diff] [blame] | 47 | license='Apache License 2.0', |
Ken Payson | 7835430 | 2017-03-06 09:28:16 -0800 | [diff] [blame] | 48 | description='Standard Protobuf Reflection Service for gRPC', |
| 49 | author='The gRPC Authors', |
| 50 | author_email='grpc-io@googlegroups.com', |
Mehrdad Afshari | bb3d95b | 2017-07-10 22:24:28 +0000 | [diff] [blame^] | 51 | url='https://grpc.io', |
Masood Malekghassemi | aff6936 | 2016-09-21 15:10:36 -0700 | [diff] [blame] | 52 | package_dir=PACKAGE_DIRECTORIES, |
| 53 | packages=setuptools.find_packages('.'), |
Masood Malekghassemi | aff6936 | 2016-09-21 15:10:36 -0700 | [diff] [blame] | 54 | install_requires=INSTALL_REQUIRES, |
| 55 | setup_requires=SETUP_REQUIRES, |
Masood Malekghassemi | cc79370 | 2017-01-13 19:20:10 -0800 | [diff] [blame] | 56 | cmdclass=COMMAND_CLASS) |