This is an automated email from the ASF dual-hosted git repository.
mmerli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pulsar.git
The following commit(s) were added to refs/heads/master by this push:
new 5ba840a Fixed python extension build (#1992)
5ba840a is described below
commit 5ba840a11b067fc9ac2e853416bbdafbb3ffbfba
Author: Matteo Merli <[email protected]>
AuthorDate: Tue Jun 19 14:16:04 2018 -0700
Fixed python extension build (#1992)
* Fixed python extension build
* Added comment
---
.../docker/build-wheel-file-within-docker.sh | 19 ++++++++++++++-----
pulsar-client-cpp/docker/build-wheels.sh | 2 +-
pulsar-client-cpp/python/pulsar/__init__.py | 6 +++---
pulsar-client-cpp/python/setup.py | 2 +-
4 files changed, 19 insertions(+), 10 deletions(-)
diff --git a/pulsar-client-cpp/docker/build-wheel-file-within-docker.sh
b/pulsar-client-cpp/docker/build-wheel-file-within-docker.sh
index d550ca9..cdaa795 100755
--- a/pulsar-client-cpp/docker/build-wheel-file-within-docker.sh
+++ b/pulsar-client-cpp/docker/build-wheel-file-within-docker.sh
@@ -18,19 +18,28 @@
# under the License.
#
-set -e
+set -ex
cd /pulsar/pulsar-client-cpp
-find . -name CMakeCache.txt | xargs rm
-find . -name CMakeFiles | xargs rm -rf
+find . -name CMakeCache.txt | xargs -r rm
+find . -name CMakeFiles | xargs -r rm -rf
cmake .
-DPYTHON_INCLUDE_DIR=/opt/python/$PYTHON_SPEC/include/python$PYTHON_VERSION \
-DPYTHON_LIBRARY=/opt/python/$PYTHON_SPEC/lib \
- -DLINK_STATIC=ON
+ -DLINK_STATIC=ON \
+ -DBUILD_TESTS=OFF
make clean
-make _pulsar
+make _pulsar -j3
cd python
python setup.py bdist_wheel
+
+# Audit wheel is required to convert a wheel that is tagged as generic
+# 'linux' into a 'multilinux' wheel.
+# Only wheel files tagged as multilinux can be uploaded to PyPI
+# Audit wheel will make sure no external dependencies are needed for
+# the shared library and that only symbols supported by most linux
+# distributions are used.
+auditwheel repair dist/pulsar_client-*-$PYTHON_SPEC-linux_x86_64.whl
diff --git a/pulsar-client-cpp/docker/build-wheels.sh
b/pulsar-client-cpp/docker/build-wheels.sh
index 35cb789..2146869 100755
--- a/pulsar-client-cpp/docker/build-wheels.sh
+++ b/pulsar-client-cpp/docker/build-wheels.sh
@@ -44,5 +44,5 @@ for line in "${PYTHON_VERSIONS[@]}"; do
IMAGE_NAME=$BUILD_IMAGE_NAME:manylinux-$PYTHON_SPEC
echo "Using image: $IMAGE_NAME"
- docker run -i -v $PWD:/pulsar $IMAGE_NAME
/build-wheel-file-within-docker.sh
+ docker run -i -v $PWD:/pulsar $IMAGE_NAME
/pulsar/pulsar-client-cpp/docker/build-wheel-file-within-docker.sh
done
diff --git a/pulsar-client-cpp/python/pulsar/__init__.py
b/pulsar-client-cpp/python/pulsar/__init__.py
index 9f87931..74d3011 100644
--- a/pulsar-client-cpp/python/pulsar/__init__.py
+++ b/pulsar-client-cpp/python/pulsar/__init__.py
@@ -100,9 +100,9 @@ import _pulsar
from _pulsar import Result, CompressionType, ConsumerType,
PartitionsRoutingMode # noqa: F401
-from functions.function import Function
-from functions.context import Context
-from functions.serde import SerDe, IdentitySerDe, PickleSerDe
+from pulsar.functions.function import Function
+from pulsar.functions.context import Context
+from pulsar.functions.serde import SerDe, IdentitySerDe, PickleSerDe
class MessageId:
"""
diff --git a/pulsar-client-cpp/python/setup.py
b/pulsar-client-cpp/python/setup.py
index ab91f0f..b20f3d6 100644
--- a/pulsar-client-cpp/python/setup.py
+++ b/pulsar-client-cpp/python/setup.py
@@ -60,7 +60,7 @@ class my_build_ext(build_ext.build_ext):
setup(
name="pulsar-client",
version=VERSION,
- py_modules=['pulsar'],
+ packages=['pulsar', 'pulsar.functions'],
cmdclass={'build_ext': my_build_ext},
ext_modules=[Extension('_pulsar', [])],