merlimat closed pull request #1992: Fixed python extension build
URL: https://github.com/apache/incubator-pulsar/pull/1992
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

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 d550ca9eff..cdaa79519a 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 35cb7895bd..2146869449 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 9f87931538..74d301117f 100644
--- a/pulsar-client-cpp/python/pulsar/__init__.py
+++ b/pulsar-client-cpp/python/pulsar/__init__.py
@@ -100,9 +100,9 @@ def send_callback(res, msg):
 
 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 ab91f0f784..b20f3d68b7 100644
--- a/pulsar-client-cpp/python/setup.py
+++ b/pulsar-client-cpp/python/setup.py
@@ -60,7 +60,7 @@ def build_extension(self, ext):
 setup(
     name="pulsar-client",
     version=VERSION,
-    py_modules=['pulsar'],
+    packages=['pulsar', 'pulsar.functions'],
     cmdclass={'build_ext': my_build_ext},
     ext_modules=[Extension('_pulsar', [])],
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to