Jan Tattermusch | 8640f92 | 2016-02-01 18:58:46 -0800 | [diff] [blame] | 1 | #!/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 | |
| 31 | set -ex |
| 32 | |
| 33 | cd $(dirname $0)/../.. |
| 34 | |
Jan Tattermusch | e066717 | 2016-02-03 15:57:57 -0800 | [diff] [blame] | 35 | if [ "$SKIP_PIP_INSTALL" == "" ] |
| 36 | then |
| 37 | pip install --upgrade six |
| 38 | pip install --upgrade setuptools |
| 39 | pip install -rrequirements.txt |
| 40 | fi |
Jan Tattermusch | 8640f92 | 2016-02-01 18:58:46 -0800 | [diff] [blame] | 41 | |
Masood Malekghassemi | 7361734 | 2016-02-18 12:39:42 -0800 | [diff] [blame] | 42 | # Build the source distribution first because MANIFEST.in cannot override |
| 43 | # exclusion of built shared objects among package resources (for some |
| 44 | # inexplicable reason). |
| 45 | GRPC_PYTHON_USE_CUSTOM_BDIST=0 \ |
| 46 | GRPC_PYTHON_BUILD_WITH_CYTHON=1 \ |
| 47 | ${SETARCH_CMD} python setup.py \ |
| 48 | sdist |
| 49 | |
Masood Malekghassemi | 2bbffcf | 2016-02-11 14:58:59 -0800 | [diff] [blame] | 50 | # 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. |
| 54 | GRPC_PYTHON_USE_CUSTOM_BDIST=0 \ |
| 55 | GRPC_PYTHON_BUILD_WITH_CYTHON=1 \ |
| 56 | ${SETARCH_CMD} python setup.py \ |
Masood Malekghassemi | f747409 | 2016-02-12 12:04:53 -0800 | [diff] [blame] | 57 | build_tagged_ext |
Masood Malekghassemi | 2bbffcf | 2016-02-11 14:58:59 -0800 | [diff] [blame] | 58 | |
Masood Malekghassemi | 7361734 | 2016-02-18 12:39:42 -0800 | [diff] [blame] | 59 | # Wheel has a bug where directories don't get excluded. |
| 60 | # https://bitbucket.org/pypa/wheel/issues/99/cannot-exclude-directory |
Craig Tiller | 5c04760 | 2016-02-05 14:25:56 -0800 | [diff] [blame] | 61 | GRPC_PYTHON_USE_CUSTOM_BDIST=0 \ |
| 62 | GRPC_PYTHON_BUILD_WITH_CYTHON=1 \ |
| 63 | ${SETARCH_CMD} python setup.py \ |
Masood Malekghassemi | 7361734 | 2016-02-18 12:39:42 -0800 | [diff] [blame] | 64 | bdist_wheel |
Masood Malekghassemi | b6d3a82 | 2016-02-11 13:08:14 -0800 | [diff] [blame] | 65 | |
Jan Tattermusch | 8640f92 | 2016-02-01 18:58:46 -0800 | [diff] [blame] | 66 | mkdir -p artifacts |
| 67 | |
Craig Tiller | 5c04760 | 2016-02-05 14:25:56 -0800 | [diff] [blame] | 68 | cp -r dist/* artifacts |