1 # Copyright 2017 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 gRPC Python's testing package."""
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__)))
24 # Break import style to ensure that we can find same-directory modules.
28 class _NoOpCommand(setuptools.Command):
34 def initialize_options(self):
37 def finalize_options(self):
44 PACKAGE_DIRECTORIES = {
50 'grpcio>={version}'.format(version=grpc_version.VERSION),
54 import testing_commands as _testing_commands
55 # we are in the build environment, otherwise the above import fails
57 # Run preprocess from the repository *before* doing any packaging!
58 'preprocess': _testing_commands.Preprocess,
62 # wire up commands to no-op not to break the external dependencies
63 'preprocess': _NoOpCommand,
67 name='grpcio-testing',
68 version=grpc_version.VERSION,
69 license='Apache License 2.0',
70 description='Testing utilities for gRPC Python',
71 author='The gRPC Authors',
72 author_email='grpc-io@googlegroups.com',
73 url='https://grpc.io',
74 package_dir=PACKAGE_DIRECTORIES,
75 packages=setuptools.find_packages('.'),
76 install_requires=INSTALL_REQUIRES,
77 cmdclass=COMMAND_CLASS)