blob: 58dc3b17dfa249fab6aecd9eb0fb53d73754259f [file] [log] [blame]
Nathaniel Manistab68f3d12015-01-23 21:32:47 +00001# 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
Nathaniel Manistab8b0adf2015-01-29 00:30:51 +000030"""A setup module for the GRPC Python package."""
Nathaniel Manistab68f3d12015-01-23 21:32:47 +000031
Nathaniel Manistab8b0adf2015-01-29 00:30:51 +000032from distutils import core as _core
Nathaniel Manistab68f3d12015-01-23 21:32:47 +000033
Nathaniel Manistaa4ead5d2015-01-31 01:33:27 +000034_EXTENSION_SOURCES = (
35 'src/_adapter/_c.c',
36 'src/_adapter/_call.c',
37 'src/_adapter/_channel.c',
38 'src/_adapter/_completion_queue.c',
39 'src/_adapter/_error.c',
40 'src/_adapter/_server.c',
41)
42
43_EXTENSION_INCLUDE_DIRECTORIES = (
44 'src',
45 # TODO(nathaniel): Can this path specification be made to work?
46 #'../../include',
47)
48
49_EXTENSION_LIBRARIES = (
50 'gpr',
51 'grpc',
52)
53
54_EXTENSION_LIBRARY_DIRECTORIES = (
55 # TODO(nathaniel): Can this path specification be made to work?
56 #'../../libs/dbg',
57)
58
59_EXTENSION_MODULE = _core.Extension(
60 '_adapter._c', sources=list(_EXTENSION_SOURCES),
61 include_dirs=_EXTENSION_INCLUDE_DIRECTORIES,
62 libraries=_EXTENSION_LIBRARIES,
63 library_dirs=_EXTENSION_LIBRARY_DIRECTORIES)
64
Nathaniel Manistab8b0adf2015-01-29 00:30:51 +000065_PACKAGES=(
Nathaniel Manistaa4ead5d2015-01-31 01:33:27 +000066 '_adapter',
Nathaniel Manistab8b0adf2015-01-29 00:30:51 +000067 '_framework',
68 '_framework.base',
69 '_framework.base.packets',
70 '_framework.common',
71 '_framework.face',
72 '_framework.face.testing',
73 '_framework.foundation',
74 '_junkdrawer',
75)
Nathaniel Manistab68f3d12015-01-23 21:32:47 +000076
Nathaniel Manistab8b0adf2015-01-29 00:30:51 +000077_PACKAGE_DIRECTORIES = {
Nathaniel Manistaa4ead5d2015-01-31 01:33:27 +000078 '_adapter': 'src/_adapter',
Nathaniel Manistab8b0adf2015-01-29 00:30:51 +000079 '_framework': 'src/_framework',
80 '_junkdrawer': 'src/_junkdrawer',
81}
82
83_core.setup(
Nathaniel Manistaa4ead5d2015-01-31 01:33:27 +000084 name='grpc', version='0.0.1',
85 ext_modules=[_EXTENSION_MODULE], packages=_PACKAGES,
Nathaniel Manistab8b0adf2015-01-29 00:30:51 +000086 package_dir=_PACKAGE_DIRECTORIES)