Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/ci-pr-validation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ jobs:
- {name: 'manylinux2014', py_suffix: ''}
- {name: 'manylinux_musl', py_suffix: '-alpine'}
python:
- {version: '3.7', spec: 'cp37-cp37m'}
- {version: '3.11', spec: 'cp311-cp311'}
cpu:
- {arch: 'x86_64', platform: 'x86_64'}
Expand Down Expand Up @@ -141,6 +142,7 @@ jobs:
strategy:
matrix:
py:
- {version: '3.7', version_long: '3.7.16'}
- {version: '3.11', version_long: '3.11.1'}

steps:
Expand Down Expand Up @@ -187,6 +189,7 @@ jobs:
fail-fast: false
matrix:
python:
- version: '3.7'
- version: '3.11'

steps:
Expand Down Expand Up @@ -227,8 +230,10 @@ jobs:
cmake --build build --config Release --target install
python -m pip install wheel
python setup.py bdist_wheel
python -m pip install ./dist/*.whl
WHEEL=$(ls dist/*.whl)
python -m pip install "$WHEEL[avro]"
python -c 'import pulsar; c = pulsar.Client("pulsar://localhost:6650"); c.close()'
python -c 'from pulsar.schema import *; s = String(); print(s.schema_info(""));'

check-completion:
name: Check Completion
Expand Down
53 changes: 27 additions & 26 deletions pkg/mac/build-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,32 +71,6 @@ else
echo "Using cached ZLib"
fi

###############################################################################
if [ ! -f Python-${PYTHON_VERSION_LONG}/.done ]; then
echo "Building Python $PYTHON_VERSION_LONG"
curl -O -L https://www.python.org/ftp/python/${PYTHON_VERSION_LONG}/Python-${PYTHON_VERSION_LONG}.tgz
tar xfz Python-${PYTHON_VERSION_LONG}.tgz

pushd Python-${PYTHON_VERSION_LONG}
if [ $PYTHON_VERSION = '3.7' ]; then
patch -p1 < ${ROOT_DIR}/pkg/mac/python-3.7.patch
fi

CFLAGS="-fPIC -O3 -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET} -I${PREFIX}/include ${PY_CFLAGS}" \
LDFLAGS=" ${PY_CFLAGS} -L${PREFIX}/lib" \
./configure --prefix=$PREFIX --enable-shared --enable-universalsdk --with-universal-archs=universal2
make -j16
make install

curl -O -L https://files.pythonhosted.org/packages/27/d6/003e593296a85fd6ed616ed962795b2f87709c3eee2bca4f6d0fe55c6d00/wheel-0.37.1-py2.py3-none-any.whl
$PREFIX/bin/pip3 install wheel-*.whl

touch .done
popd
else
echo "Using cached Python $PYTHON_VERSION_LONG"
fi

###############################################################################
OPENSSL_VERSION_UNDERSCORE=$(echo $OPENSSL_VERSION | sed 's/\./_/g')
if [ ! -f openssl-OpenSSL_${OPENSSL_VERSION_UNDERSCORE}.done ]; then
Expand Down Expand Up @@ -135,6 +109,33 @@ else
echo "Using cached OpenSSL"
fi

###############################################################################
if [ ! -f Python-${PYTHON_VERSION_LONG}/.done ]; then
echo "Building Python $PYTHON_VERSION_LONG"
curl -O -L https://www.python.org/ftp/python/${PYTHON_VERSION_LONG}/Python-${PYTHON_VERSION_LONG}.tgz
tar xfz Python-${PYTHON_VERSION_LONG}.tgz

pushd Python-${PYTHON_VERSION_LONG}
if [ $PYTHON_VERSION = '3.7' ]; then
patch -p1 < ${ROOT_DIR}/pkg/mac/python-3.7.patch
fi

CFLAGS="-fPIC -O3 -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET} -I${PREFIX}/include ${PY_CFLAGS}" \
LDFLAGS=" ${PY_CFLAGS} -L${PREFIX}/lib" \
./configure --prefix=$PREFIX --enable-shared --enable-universalsdk --with-universal-archs=universal2 \
--with-openssl=$PREFIX
make -j16
make install

curl -O -L https://files.pythonhosted.org/packages/27/d6/003e593296a85fd6ed616ed962795b2f87709c3eee2bca4f6d0fe55c6d00/wheel-0.37.1-py2.py3-none-any.whl
$PREFIX/bin/pip3 install wheel-*.whl

touch .done
popd
else
echo "Using cached Python $PYTHON_VERSION_LONG"
fi

###############################################################################
BOOST_VERSION_=${BOOST_VERSION//./_}
if [ ! -f boost/.done ]; then
Expand Down
8 changes: 4 additions & 4 deletions pkg/mac/build-mac-wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ $PY_EXE setup.py bdist_wheel
PY_SPEC=$(echo $PYTHON_VERSION | sed 's/\.//g')

cd /tmp
$PIP_EXE install --no-dependencies --force-reinstall \
$ROOT_DIR/dist/pulsar_client-${PYTHON_CLIENT_VERSION}-cp$PY_SPEC-*-macosx_10_15_${PIP_TAG}.whl
$PY_EXE -c 'import pulsar'

WHEEL=$(ls $ROOT_DIR/dist/pulsar_client-${PYTHON_CLIENT_VERSION}-cp$PY_SPEC-*-macosx_10_15_${PIP_TAG}.whl)
$PIP_EXE install --no-dependencies --force-reinstall "$WHEEL[avro]"
$PY_EXE -c 'import pulsar; c = pulsar.Client("pulsar://localhost:6650"); c.close()'
$PY_EXE -c 'from pulsar.schema import *; s = String(); print(s.schema_info(""));'
6 changes: 4 additions & 2 deletions pkg/test-wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ set -e -x

cd /

pip3 install /pulsar-client-python/wheelhouse/pulsar_client-*.whl
WHEEL=$(ls /pulsar-client-python/wheelhouse/pulsar_client-*.whl)
pip3 install "$WHEEL[avro]"

# Load the wheel to ensure there are no linking problems
python3 -c 'import pulsar'
python3 -c 'import pulsar; c = pulsar.Client("pulsar://localhost:6650"); c.close()'
python3 -c 'from pulsar.schema import *; s = String(); print(s.schema_info(""));'