From 7a55684a1305c73b0d7924d5cf04a52c093bd1bc Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 5 Feb 2016 11:33:30 -0800 Subject: Clang format and fix copyrights --- test/distrib/python/distribtest.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'test/distrib/python') diff --git a/test/distrib/python/distribtest.py b/test/distrib/python/distribtest.py index 428ffe2b34..66c1f88796 100644 --- a/test/distrib/python/distribtest.py +++ b/test/distrib/python/distribtest.py @@ -1,3 +1,32 @@ +# Copyright 2015-2016, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + from grpc.beta import implementations # This code doesn't do much but makes sure the native extension is loaded -- cgit v1.2.3 From 5c04760d46f2628a83106d048e732c997fed8801 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 5 Feb 2016 14:25:56 -0800 Subject: Change default on Python install option --- src/python/grpcio/commands.py | 2 +- test/distrib/python/run_distrib_test.sh | 3 +-- tools/run_tests/build_artifact_python.sh | 10 ++++++---- 3 files changed, 8 insertions(+), 7 deletions(-) (limited to 'test/distrib/python') diff --git a/src/python/grpcio/commands.py b/src/python/grpcio/commands.py index 490d0f07b3..31bd00e94e 100644 --- a/src/python/grpcio/commands.py +++ b/src/python/grpcio/commands.py @@ -135,7 +135,7 @@ class Install(install.install, EggNameMixin): def initialize_options(self): install.install.initialize_options(self) - self.use_grpc_custom_bdist = False + self.use_grpc_custom_bdist = bool(int(os.environ.get('GRPC_PYTHON_USE_CUSTOM_BDIST', '1'))) def finalize_options(self): install.install.finalize_options(self) diff --git a/test/distrib/python/run_distrib_test.sh b/test/distrib/python/run_distrib_test.sh index a185bcbc26..2148be121a 100755 --- a/test/distrib/python/run_distrib_test.sh +++ b/test/distrib/python/run_distrib_test.sh @@ -52,7 +52,6 @@ pip install --upgrade futures GRPC_PYTHON_BINARIES_REPOSITORY="${BDIST_DIR}" \ pip install \ - "${SDIST_ARCHIVE}" \ - --install-option="--use-grpc-custom-bdist" + "${SDIST_ARCHIVE}" python distribtest.py diff --git a/tools/run_tests/build_artifact_python.sh b/tools/run_tests/build_artifact_python.sh index 48cf390f69..835fad83e1 100755 --- a/tools/run_tests/build_artifact_python.sh +++ b/tools/run_tests/build_artifact_python.sh @@ -39,11 +39,13 @@ then pip install -rrequirements.txt fi -GRPC_PYTHON_BUILD_WITH_CYTHON=1 ${SETARCH_CMD} python setup.py \ - bdist_wheel \ - sdist \ +GRPC_PYTHON_USE_CUSTOM_BDIST=0 \ +GRPC_PYTHON_BUILD_WITH_CYTHON=1 \ +${SETARCH_CMD} python setup.py \ + bdist_wheel \ + sdist \ bdist_egg_grpc_custom mkdir -p artifacts -cp -r dist/* artifacts \ No newline at end of file +cp -r dist/* artifacts -- cgit v1.2.3 From 6b5555ead1a0a7141d28bec505f5421a4101763d Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 5 Feb 2016 16:07:18 -0800 Subject: Fix docker files, distrib test script --- test/distrib/python/run_distrib_test.sh | 17 +++++++++-------- tools/dockerfile/distribtest/python_arch_x64/Dockerfile | 5 +++-- .../distribtest/python_centos6_x64/Dockerfile | 2 ++ 3 files changed, 14 insertions(+), 10 deletions(-) (limited to 'test/distrib/python') diff --git a/test/distrib/python/run_distrib_test.sh b/test/distrib/python/run_distrib_test.sh index 2148be121a..08856ad388 100755 --- a/test/distrib/python/run_distrib_test.sh +++ b/test/distrib/python/run_distrib_test.sh @@ -42,16 +42,17 @@ then exit 1 fi -# TODO(jtattermusch): this shouldn't be required -pip install --upgrade six +PIP=pip2 +which $PIP || PIP=pip +PYTHON=python2 +which $PYTHON || PYTHON=python -# TODO(jtattermusch): if these don't get preinstalled, pip tries to install them -# with --use-grpc-custom-bdist option, which obviously fails. -pip install --upgrade enum34 -pip install --upgrade futures +# TODO(jtattermusch): this shouldn't be required +$PIP install --upgrade six GRPC_PYTHON_BINARIES_REPOSITORY="${BDIST_DIR}" \ - pip install \ + $PIP install \ "${SDIST_ARCHIVE}" -python distribtest.py +$PYTHON distribtest.py + diff --git a/tools/dockerfile/distribtest/python_arch_x64/Dockerfile b/tools/dockerfile/distribtest/python_arch_x64/Dockerfile index 4d10e240c6..536ad86d53 100644 --- a/tools/dockerfile/distribtest/python_arch_x64/Dockerfile +++ b/tools/dockerfile/distribtest/python_arch_x64/Dockerfile @@ -31,6 +31,7 @@ FROM base/archlinux RUN pacman --noconfirm -Syy RUN pacman --noconfirm -S git -RUN pacman --noconfirm -S python -RUN pacman --noconfirm -S python-pip +RUN pacman --noconfirm -S openssl +RUN pacman --noconfirm -S python2 +RUN pacman --noconfirm -S python2-pip diff --git a/tools/dockerfile/distribtest/python_centos6_x64/Dockerfile b/tools/dockerfile/distribtest/python_centos6_x64/Dockerfile index 683686c6db..55677fc10c 100644 --- a/tools/dockerfile/distribtest/python_centos6_x64/Dockerfile +++ b/tools/dockerfile/distribtest/python_centos6_x64/Dockerfile @@ -35,3 +35,5 @@ RUN yum install -y python RUN rpm -ivh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm RUN yum install -y python-pip +RUN pip install --upgrade pip + -- cgit v1.2.3 From 6677a86283989ea70803b2292b5836fbd8f0fe96 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Tue, 9 Feb 2016 08:00:41 -0800 Subject: do not hardcode the python package version --- test/distrib/python/run_distrib_test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/distrib/python') diff --git a/test/distrib/python/run_distrib_test.sh b/test/distrib/python/run_distrib_test.sh index 08856ad388..d941869733 100755 --- a/test/distrib/python/run_distrib_test.sh +++ b/test/distrib/python/run_distrib_test.sh @@ -32,8 +32,8 @@ set -ex cd $(dirname $0) -# TODO(jtattermusch): replace the version number -SDIST_ARCHIVE="$EXTERNAL_GIT_ROOT/input_artifacts/grpcio-0.12.0b8.tar.gz" +# Pick up the source dist archive whatever its version is +SDIST_ARCHIVE=$EXTERNAL_GIT_ROOT/input_artifacts/grpcio-*.tar.gz BDIST_DIR="file://$EXTERNAL_GIT_ROOT/input_artifacts" if [ ! -f "${SDIST_ARCHIVE}" ] -- cgit v1.2.3 From 0474a1c393811034b281b8fc014604055c30a862 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Tue, 9 Feb 2016 08:34:02 -0800 Subject: python fixes --- test/distrib/python/run_distrib_test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/distrib/python') diff --git a/test/distrib/python/run_distrib_test.sh b/test/distrib/python/run_distrib_test.sh index d941869733..8fd7ffb54c 100755 --- a/test/distrib/python/run_distrib_test.sh +++ b/test/distrib/python/run_distrib_test.sh @@ -36,7 +36,7 @@ cd $(dirname $0) SDIST_ARCHIVE=$EXTERNAL_GIT_ROOT/input_artifacts/grpcio-*.tar.gz BDIST_DIR="file://$EXTERNAL_GIT_ROOT/input_artifacts" -if [ ! -f "${SDIST_ARCHIVE}" ] +if [ ! -f ${SDIST_ARCHIVE} ] then echo "Archive ${SDIST_ARCHIVE} does not exist." exit 1 @@ -52,7 +52,7 @@ $PIP install --upgrade six GRPC_PYTHON_BINARIES_REPOSITORY="${BDIST_DIR}" \ $PIP install \ - "${SDIST_ARCHIVE}" + ${SDIST_ARCHIVE} $PYTHON distribtest.py -- cgit v1.2.3