aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/run_tests/build_python.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tools/run_tests/build_python.sh')
-rwxr-xr-xtools/run_tests/build_python.sh22
1 files changed, 17 insertions, 5 deletions
diff --git a/tools/run_tests/build_python.sh b/tools/run_tests/build_python.sh
index d9b7644f44..108dd6aeff 100755
--- a/tools/run_tests/build_python.sh
+++ b/tools/run_tests/build_python.sh
@@ -34,9 +34,21 @@ set -ex
cd $(dirname $0)/../..
root=`pwd`
-rm -rf python2.7_virtual_environment
-virtualenv -p /usr/bin/python2.7 python2.7_virtual_environment
-source python2.7_virtual_environment/bin/activate
-pip install -r src/python/requirements.txt
-CFLAGS="-I$root/include -std=c89 -Werror" LDFLAGS=-L$root/libs/$CONFIG pip install src/python/src
+
+if [ ! -d 'python2.7_virtual_environment' ]
+then
+ # Build the entire virtual environment
+ virtualenv -p /usr/bin/python2.7 python2.7_virtual_environment
+ source python2.7_virtual_environment/bin/activate
+ pip install -r src/python/requirements.txt
+else
+ source python2.7_virtual_environment/bin/activate
+ # Uninstall and re-install the packages we care about. Don't use
+ # --force-reinstall or --ignore-installed to avoid propagating this
+ # unnecessarily to dependencies. Don't use --no-deps to avoid missing
+ # dependency upgrades.
+ (yes | pip uninstall grpcio) || true
+ (yes | pip uninstall interop) || true
+fi
+CFLAGS="-I$root/include -std=c89" LDFLAGS=-L$root/libs/$CONFIG GRPC_PYTHON_BUILD_WITH_CYTHON=1 pip install src/python/src
pip install src/python/interop