This is an automated email from the ASF dual-hosted git repository.

mmerli pushed a commit to branch fix-python-build
in repository https://gitbox.apache.org/repos/asf/incubator-pulsar.git

commit 2f2104b0139f86ee765c71ea1ba889a062a94efc
Author: Matteo Merli <mme...@apache.org>
AuthorDate: Mon Jun 18 17:03:22 2018 -0700

    Fixed python extension build
---
 pulsar-client-cpp/docker/build-wheel-file-within-docker.sh | 14 +++++++++-----
 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, 14 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..d4cb9af 100755
--- a/pulsar-client-cpp/docker/build-wheel-file-within-docker.sh
+++ b/pulsar-client-cpp/docker/build-wheel-file-within-docker.sh
@@ -1,4 +1,5 @@
 #!/bin/bash
+
 #
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
@@ -18,19 +19,22 @@
 # under the License.
 #
 
-set -e
+set -e -x
 
 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
+
+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 d8254d3..01a160f 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', [])],
 

Reply via email to