blob: 20edbc4ec07616711240b23ff7150490e06a8a21 [file] [log] [blame]
Jan Tattermusch7897ae92017-06-07 22:57:36 +02001# Copyright 2016 gRPC authors.
Masood Malekghassemiaff69362016-09-21 15:10:36 -07002#
Jan Tattermusch7897ae92017-06-07 22:57:36 +02003# 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 Malekghassemiaff69362016-09-21 15:10:36 -07006#
Jan Tattermusch7897ae92017-06-07 22:57:36 +02007# http://www.apache.org/licenses/LICENSE-2.0
Masood Malekghassemiaff69362016-09-21 15:10:36 -07008#
Jan Tattermusch7897ae92017-06-07 22:57:36 +02009# 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 Malekghassemiaff69362016-09-21 15:10:36 -070014"""Setup module for the GRPC Python package's optional reflection."""
15
16import os
17import sys
18
19import setuptools
20
21# Ensure we're in the proper directory whether or not we're being used by pip.
22os.chdir(os.path.dirname(os.path.abspath(__file__)))
23
24# Break import-style to ensure we can actually find our commands module.
25import reflection_commands
26import grpc_version
27
Ken Payson2fa5f2f2017-02-06 10:27:09 -080028PACKAGE_DIRECTORIES = {
29 '': '.',
30}
Masood Malekghassemiaff69362016-09-21 15:10:36 -070031
32SETUP_REQUIRES = (
Masood Malekghassemicc793702017-01-13 19:20:10 -080033 'grpcio-tools>={version}'.format(version=grpc_version.VERSION),)
Masood Malekghassemiaff69362016-09-21 15:10:36 -070034
Ken Payson02909062017-05-04 12:33:58 -070035INSTALL_REQUIRES = ('protobuf>=3.3.0',
Ken Payson2fa5f2f2017-02-06 10:27:09 -080036 'grpcio>={version}'.format(version=grpc_version.VERSION),)
Masood Malekghassemiaff69362016-09-21 15:10:36 -070037
38COMMAND_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
44setuptools.setup(
45 name='grpcio-reflection',
46 version=grpc_version.VERSION,
Jan Tattermusch4d5c3102017-06-07 10:23:56 +020047 license='Apache License 2.0',
Ken Payson78354302017-03-06 09:28:16 -080048 description='Standard Protobuf Reflection Service for gRPC',
49 author='The gRPC Authors',
50 author_email='grpc-io@googlegroups.com',
Mehrdad Afsharibb3d95b2017-07-10 22:24:28 +000051 url='https://grpc.io',
Masood Malekghassemiaff69362016-09-21 15:10:36 -070052 package_dir=PACKAGE_DIRECTORIES,
53 packages=setuptools.find_packages('.'),
Masood Malekghassemiaff69362016-09-21 15:10:36 -070054 install_requires=INSTALL_REQUIRES,
55 setup_requires=SETUP_REQUIRES,
Masood Malekghassemicc793702017-01-13 19:20:10 -080056 cmdclass=COMMAND_CLASS)