diff options
Diffstat (limited to 'tools/run_tests/build_python.sh')
-rwxr-xr-x | tools/run_tests/build_python.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/run_tests/build_python.sh b/tools/run_tests/build_python.sh index 594c20b14c..b1c90df824 100755 --- a/tools/run_tests/build_python.sh +++ b/tools/run_tests/build_python.sh @@ -34,6 +34,7 @@ set -ex cd $(dirname $0)/../.. TOX_PYTHON_ENV="$1" +PY_VERSION="${TOX_PYTHON_ENV: -2}" ROOT=`pwd` export LD_LIBRARY_PATH=$ROOT/libs/$CONFIG @@ -51,7 +52,25 @@ fi tox -e ${TOX_PYTHON_ENV} --notest +# We force the .so naming convention in PEP 3149 for side by side installation support +# Note this is the default in Python3, but explicitly disabled for Darwin, so we only +# use this hack for our testing environment. +if [ "$PY_VERSION" -gt "27" ] +then + mv $ROOT/src/python/grpcio/grpc/_cython/cygrpc.so $ROOT/src/python/grpcio/grpc/_cython/cygrpc.so.backup || true +fi + $ROOT/.tox/${TOX_PYTHON_ENV}/bin/python $ROOT/setup.py build $ROOT/.tox/${TOX_PYTHON_ENV}/bin/python $ROOT/setup.py build_py $ROOT/.tox/${TOX_PYTHON_ENV}/bin/python $ROOT/setup.py build_ext --inplace $ROOT/.tox/${TOX_PYTHON_ENV}/bin/python $ROOT/setup.py gather --test + +if [ "$PY_VERSION" -gt "27" ] +then + mv $ROOT/src/python/grpcio/grpc/_cython/cygrpc.so $ROOT/src/python/grpcio/grpc/_cython/cygrpc.cpython-${PY_VERSION}m.so || true + mv $ROOT/src/python/grpcio/grpc/_cython/cygrpc.so.backup $ROOT/src/python/grpcio/grpc/_cython/cygrpc.so || true +fi + +# Build the health checker +$ROOT/.tox/${TOX_PYTHON_ENV}/bin/python $ROOT/src/python/grpcio_health_checking/setup.py build +$ROOT/.tox/${TOX_PYTHON_ENV}/bin/python $ROOT/src/python/grpcio_health_checking/setup.py build_py |