blob: 375fbd6c77decb7798fd1b2ade2a8d08dbe613f1 [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
Masood Malekghassemi1ff429d2016-06-02 16:39:20 -070034import sys
35
Masood Malekghassemi1ff429d2016-06-02 16:39:20 -070036import setuptools
Masood Malekghassemi1ff429d2016-06-02 16:39:20 -070037
Masood Malekghassemifb261bf2016-12-12 13:19:31 -080038import grpc_tools.command
Masood Malekghassemi1ff429d2016-06-02 16:39:20 -070039
40PY3 = sys.version_info.major == 3
41
42# Ensure we're in the proper directory whether or not we're being used by pip.
43os.chdir(os.path.dirname(os.path.abspath(__file__)))
44
45# Break import-style to ensure we can actually find our in-repo dependencies.
46import commands
47import grpc_version
48
49LICENSE = '3-clause BSD'
50
51PACKAGE_DIRECTORIES = {
52 '': '.',
53}
54
55INSTALL_REQUIRES = (
56 'coverage>=4.0',
57 'enum34>=1.0.4',
58 'futures>=2.2.0',
Ken Payson83489732016-08-18 11:27:47 -070059 'grpcio>={version}'.format(version=grpc_version.VERSION),
60 'grpcio-tools>={version}'.format(version=grpc_version.VERSION),
61 'grpcio-health-checking>={version}'.format(version=grpc_version.VERSION),
Masood Malekghassemi1ff429d2016-06-02 16:39:20 -070062 'oauth2client>=1.4.7',
Ken Paysone5fd01a2016-08-02 12:06:21 -070063 'protobuf>=3.0.0',
Masood Malekghassemi1ff429d2016-06-02 16:39:20 -070064 'six>=1.10',
65)
66
Masood Malekghassemi1ff429d2016-06-02 16:39:20 -070067COMMAND_CLASS = {
68 # Run `preprocess` *before* doing any packaging!
69 'preprocess': commands.GatherProto,
70
Masood Malekghassemifb261bf2016-12-12 13:19:31 -080071 'build_package_protos': grpc_tools.command.BuildPackageProtos,
Masood Malekghassemi1ff429d2016-06-02 16:39:20 -070072 'build_py': commands.BuildPy,
73 'run_interop': commands.RunInterop,
74 'test_lite': commands.TestLite
75}
76
77PACKAGE_DATA = {
78 'tests.interop': [
79 'credentials/ca.pem',
80 'credentials/server1.key',
81 'credentials/server1.pem',
82 ],
Masood Malekghassemid9539592016-10-20 14:47:14 -070083 'tests.protoc_plugin.protos.invocation_testing': [
84 'same.proto',
85 ],
86 'tests.protoc_plugin.protos.invocation_testing.split_messages': [
87 'messages.proto',
88 ],
89 'tests.protoc_plugin.protos.invocation_testing.split_services': [
90 'services.proto',
Masood Malekghassemi1ff429d2016-06-02 16:39:20 -070091 ],
92 'tests.unit': [
93 'credentials/ca.pem',
94 'credentials/server1.key',
95 'credentials/server1.pem',
96 ],
97 'tests': [
98 'tests.json'
99 ],
100}
101
102TEST_SUITE = 'tests'
103TEST_LOADER = 'tests:Loader'
104TEST_RUNNER = 'tests:Runner'
105TESTS_REQUIRE = INSTALL_REQUIRES
106
107PACKAGES = setuptools.find_packages('.')
108
109setuptools.setup(
110 name='grpcio-tests',
111 version=grpc_version.VERSION,
112 license=LICENSE,
113 packages=list(PACKAGES),
114 package_dir=PACKAGE_DIRECTORIES,
115 package_data=PACKAGE_DATA,
116 install_requires=INSTALL_REQUIRES,
Masood Malekghassemi1ff429d2016-06-02 16:39:20 -0700117 cmdclass=COMMAND_CLASS,
118 tests_require=TESTS_REQUIRE,
119 test_suite=TEST_SUITE,
120 test_loader=TEST_LOADER,
121 test_runner=TEST_RUNNER,
122)