Exclude cygrpc.so from the Python package

pull/5319/head
Masood Malekghassemi 9 years ago
parent a5fc9818e1
commit 736173487c
  1. 3
      PYTHON-MANIFEST.in
  2. 1
      setup.py
  3. 2
      src/python/grpcio/precompiled.py
  4. 13
      tools/run_tests/build_artifact_python.sh

@ -1,4 +1,5 @@
graft src/python/grpcio/grpc
recursive-include src/python/grpcio/grpc *.c *.h *.py *.pyx *.pxd *.pxi *.python *.pem
recursive-exclude src/python/grpcio/grpc/_cython *.so *.pyd
graft src/python/grpcio/tests
graft src/core
graft include/grpc

@ -210,7 +210,6 @@ PACKAGE_DATA = {
'grpc._cython': [
'_windows/grpc_c.32.python',
'_windows/grpc_c.64.python',
'cygrpc.so',
],
}
if INSTALL_TESTS:

@ -100,3 +100,5 @@ def update_setup_arguments(setup_arguments):
sys.stderr.write(
'could not write precompiled extension to directory: {} -> {}\n'
.format(url, target_path))
return
setup_arguments['package_data']['grpc._cython'].append('cygrpc.so')

@ -39,6 +39,14 @@ then
pip install -rrequirements.txt
fi
# Build the source distribution first because MANIFEST.in cannot override
# exclusion of built shared objects among package resources (for some
# inexplicable reason).
GRPC_PYTHON_USE_CUSTOM_BDIST=0 \
GRPC_PYTHON_BUILD_WITH_CYTHON=1 \
${SETARCH_CMD} python setup.py \
sdist
# The bdist_wheel_grpc_custom command is finicky about command output ordering
# and thus ought to be run in a shell command separate of others. Further, it
# trashes the actual bdist_wheel output, so it should be run first so that
@ -48,11 +56,12 @@ GRPC_PYTHON_BUILD_WITH_CYTHON=1 \
${SETARCH_CMD} python setup.py \
build_tagged_ext
# Wheel has a bug where directories don't get excluded.
# https://bitbucket.org/pypa/wheel/issues/99/cannot-exclude-directory
GRPC_PYTHON_USE_CUSTOM_BDIST=0 \
GRPC_PYTHON_BUILD_WITH_CYTHON=1 \
${SETARCH_CMD} python setup.py \
bdist_wheel \
sdist
bdist_wheel
mkdir -p artifacts

Loading…
Cancel
Save