blob: 7ba04d75463f3ef0dc26da70e759bf0bec60fcf2 [file] [log] [blame]
Jan Tattermusch8640f922016-02-01 18:58:46 -08001#!/bin/bash
2# Copyright 2016, Google Inc.
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met:
8#
9# * Redistributions of source code must retain the above copyright
10# notice, this list of conditions and the following disclaimer.
11# * Redistributions in binary form must reproduce the above
12# copyright notice, this list of conditions and the following disclaimer
13# in the documentation and/or other materials provided with the
14# distribution.
15# * Neither the name of Google Inc. nor the names of its
16# contributors may be used to endorse or promote products derived from
17# this software without specific prior written permission.
18#
19# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
31set -ex
32
33cd $(dirname $0)/../..
34
Jan Tattermusche0667172016-02-03 15:57:57 -080035if [ "$SKIP_PIP_INSTALL" == "" ]
36then
37 pip install --upgrade six
38 pip install --upgrade setuptools
39 pip install -rrequirements.txt
40fi
Jan Tattermusch8640f922016-02-01 18:58:46 -080041
Masood Malekghassemi73617342016-02-18 12:39:42 -080042# Build the source distribution first because MANIFEST.in cannot override
43# exclusion of built shared objects among package resources (for some
44# inexplicable reason).
45GRPC_PYTHON_USE_CUSTOM_BDIST=0 \
46GRPC_PYTHON_BUILD_WITH_CYTHON=1 \
47${SETARCH_CMD} python setup.py \
48 sdist
49
Masood Malekghassemi2bbffcf2016-02-11 14:58:59 -080050# The bdist_wheel_grpc_custom command is finicky about command output ordering
51# and thus ought to be run in a shell command separate of others. Further, it
52# trashes the actual bdist_wheel output, so it should be run first so that
53# bdist_wheel may be run unmolested.
54GRPC_PYTHON_USE_CUSTOM_BDIST=0 \
55GRPC_PYTHON_BUILD_WITH_CYTHON=1 \
56${SETARCH_CMD} python setup.py \
Masood Malekghassemif7474092016-02-12 12:04:53 -080057 build_tagged_ext
Masood Malekghassemi2bbffcf2016-02-11 14:58:59 -080058
Masood Malekghassemi73617342016-02-18 12:39:42 -080059# Wheel has a bug where directories don't get excluded.
60# https://bitbucket.org/pypa/wheel/issues/99/cannot-exclude-directory
Craig Tiller5c047602016-02-05 14:25:56 -080061GRPC_PYTHON_USE_CUSTOM_BDIST=0 \
62GRPC_PYTHON_BUILD_WITH_CYTHON=1 \
63${SETARCH_CMD} python setup.py \
Masood Malekghassemi73617342016-02-18 12:39:42 -080064 bdist_wheel
Masood Malekghassemib6d3a822016-02-11 13:08:14 -080065
Jan Tattermusch8640f922016-02-01 18:58:46 -080066mkdir -p artifacts
67
Craig Tiller5c047602016-02-05 14:25:56 -080068cp -r dist/* artifacts