blob: 5c60eaca3a3dd5c1e583ccfc8d4ede9b98f37c4a [file] [log] [blame]
Masood Malekghassemi1ff429d2016-06-02 16:39:20 -07001# Copyright 2015, Google Inc.
2# All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met:
7#
8# * Redistributions of source code must retain the above copyright
9# notice, this list of conditions and the following disclaimer.
10# * Redistributions in binary form must reproduce the above
11# copyright notice, this list of conditions and the following disclaimer
12# in the documentation and/or other materials provided with the
13# distribution.
14# * Neither the name of Google Inc. nor the names of its
15# contributors may be used to endorse or promote products derived from
16# this software without specific prior written permission.
17#
18# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
30"""A setup module for the gRPC Python package."""
31
32import os
33import os.path
34import shutil
35import sys
36
37from distutils import core as _core
38from distutils import extension as _extension
39import setuptools
40from setuptools.command import egg_info
41
42import grpc.tools.command
43
44PY3 = sys.version_info.major == 3
45
46# Ensure we're in the proper directory whether or not we're being used by pip.
47os.chdir(os.path.dirname(os.path.abspath(__file__)))
48
49# Break import-style to ensure we can actually find our in-repo dependencies.
50import commands
51import grpc_version
52
53LICENSE = '3-clause BSD'
54
55PACKAGE_DIRECTORIES = {
56 '': '.',
57}
58
59INSTALL_REQUIRES = (
60 'coverage>=4.0',
61 'enum34>=1.0.4',
62 'futures>=2.2.0',
63 'grpcio>=0.14.0',
64 'grpcio-health-checking>=0.14.0',
65 'oauth2client>=1.4.7',
Ken Paysone5fd01a2016-08-02 12:06:21 -070066 'protobuf>=3.0.0',
Masood Malekghassemi1ff429d2016-06-02 16:39:20 -070067 'six>=1.10',
68)
69
70SETUP_REQUIRES = (
71 'grpcio-tools>=0.14.0',
72)
73
74COMMAND_CLASS = {
75 # Run `preprocess` *before* doing any packaging!
76 'preprocess': commands.GatherProto,
77
Ken Paysondd24c1e2016-07-13 14:18:33 -070078 'build_package_protos': grpc.tools.command.BuildPackageProtos,
Masood Malekghassemi1ff429d2016-06-02 16:39:20 -070079 'build_py': commands.BuildPy,
80 'run_interop': commands.RunInterop,
81 'test_lite': commands.TestLite
82}
83
84PACKAGE_DATA = {
85 'tests.interop': [
86 'credentials/ca.pem',
87 'credentials/server1.key',
88 'credentials/server1.pem',
89 ],
90 'tests.protoc_plugin': [
91 'protoc_plugin_test.proto',
92 ],
93 'tests.unit': [
94 'credentials/ca.pem',
95 'credentials/server1.key',
96 'credentials/server1.pem',
97 ],
98 'tests': [
99 'tests.json'
100 ],
101}
102
103TEST_SUITE = 'tests'
104TEST_LOADER = 'tests:Loader'
105TEST_RUNNER = 'tests:Runner'
106TESTS_REQUIRE = INSTALL_REQUIRES
107
108PACKAGES = setuptools.find_packages('.')
109
110setuptools.setup(
111 name='grpcio-tests',
112 version=grpc_version.VERSION,
113 license=LICENSE,
114 packages=list(PACKAGES),
115 package_dir=PACKAGE_DIRECTORIES,
116 package_data=PACKAGE_DATA,
117 install_requires=INSTALL_REQUIRES,
118 setup_requires=SETUP_REQUIRES,
119 cmdclass=COMMAND_CLASS,
120 tests_require=TESTS_REQUIRE,
121 test_suite=TEST_SUITE,
122 test_loader=TEST_LOADER,
123 test_runner=TEST_RUNNER,
124)