pulsar icon indicating copy to clipboard operation
pulsar copied to clipboard

When will Python 3.10 be supported

Open thecodeway opened this issue 4 years ago • 7 comments

Pulsar Python client from the doc(https://pulsar.apache.org/docs/en/client-libraries-python/), highest support version was python 3.8(linux)、python 3.(mac). My current version is 3.10. I hope it can be supported

thecodeway avatar Dec 14 '21 04:12 thecodeway

I was missing support for Linux, Python 3.9 and pulsar-client 2.8.1 and I was able to compile the wheel myself (using Ubuntu 21.10). Perhaps you could do the same for 3.10 in the meantime.

I checked out this Git repo, switched to v2.8.1 tag and back-ported the diff from pull request which introduced the dockerized build for Python 3.9 (which has to use manylinux2014 instead of manylinux1 due to an upstream library): https://github.com/apache/pulsar/pull/10954/files

Then I simply ran docker-build.python3.9.sh in pulsar-client-cpp folder and waited over an hour.

sarimak avatar Dec 15 '21 09:12 sarimak

Since the build script is using PyPA's official base Docker image for manylinux wheels, it could be just a matter of changing the PYTHON_VERSION="3.9" and PYTHON_SPEC="cp39-cp39" to 3.10 (in the build script) and adding it to PYTHON_VERSIONS (both in build-wheels.sh and create-images.sh).

Since the whole build happens inside the Docker container, there is no need to install C++ libraries on your physical workstation. The final step which is running the auditwheel repair failed for me (wrong commandline arguments I think) but I think it is not needed for the build itself.

sarimak avatar Dec 15 '21 09:12 sarimak

Since the build script is using PyPA's official base Docker image for manylinux wheels, it could be just a matter of changing the PYTHON_VERSION="3.9" and PYTHON_SPEC="cp39-cp39" to 3.10 (in the build script) and adding it to PYTHON_VERSIONS (both in build-wheels.sh and create-images.sh).

Since the whole build happens inside the Docker container, there is no need to install C++ libraries on your physical workstation. The final step which is running the auditwheel repair failed for me (wrong commandline arguments I think) but I think it is not needed for the build itself.

Thank you for your reply. I'll try as you say

thecodeway avatar Dec 15 '21 13:12 thecodeway

The issue had no activity for 30 days, mark with Stale label.

github-actions[bot] avatar Feb 26 '22 01:02 github-actions[bot]

I was missing support for Linux, Python 3.9 and pulsar-client 2.8.1 and I was able to compile the wheel myself (using Ubuntu 21.10). Perhaps you could do the same for 3.10 in the meantime.

I checked out this Git repo, switched to v2.8.1 tag and back-ported the diff from pull request which introduced the dockerized build for Python 3.9 (which has to use manylinux2014 instead of manylinux1 due to an upstream library): https://github.com/apache/pulsar/pull/10954/files

Then I simply ran docker-build.python3.9.sh in pulsar-client-cpp folder and waited over an hour.

manylinux2014 does not support python 3.10. However,the new manylinux is based on Debian 9. https://github.com/pypa/manylinux

zmskco avatar Mar 09 '22 11:03 zmskco

@thecodeway @sarimak @holdlg Closing this since we now have 3.10 packages available

merlimat avatar Apr 09 '22 00:04 merlimat

@thecodeway

pulsar-client-cpp and py3-pulsar-client-cpp packages are available on Alpine Linux (Edge repository)

# apk search pulsar-client

py3-pulsar-client-cpp-2.9.2-r0
pulsar-client-cpp-static-2.9.2-r0
pulsar-client-cpp-2.9.2-r0
pulsar-client-cpp-dev-2.9.2-r0
# apk info py3-pulsar-client-cpp

py3-pulsar-client-cpp-2.9.2-r0 description:
Python bindings for Apache Pulsar C++ client
# apk info pulsar-client-cpp

pulsar-client-cpp-2.9.2-r0 description:
Apache Pulsar C++ client
Dockerfile:

FROM alpine:latest
RUN apk add --no-cache \
	-X https://dl-cdn.alpinelinux.org/alpine/edge/main \
	-X https://dl-cdn.alpinelinux.org/alpine/edge/community \
	-X https://dl-cdn.alpinelinux.org/alpine/edge/testing \
	pulsar-client-cpp-dev py3-pulsar-client-cpp py3-six py3-certifi
# docker build -t <image> .
# docker run -it <image>

/ # ldd /usr/lib/libpulsar.so 
	/lib/ld-musl-x86_64.so.1 (0x7f6906c02000)
	libprotobuf.so.29 => /usr/lib/libprotobuf.so.29 (0x7f690666f000)
	libcurl.so.4 => /usr/lib/libcurl.so.4 (0x7f69065f3000)
	libssl.so.1.1 => /lib/libssl.so.1.1 (0x7f6906572000)
	libcrypto.so.1.1 => /lib/libcrypto.so.1.1 (0x7f69062f1000)
	libz.so.1 => /lib/libz.so.1 (0x7f69062d7000)
	libzstd.so.1 => /usr/lib/libzstd.so.1 (0x7f6906259000)
	libsnappy.so.1 => /usr/lib/libsnappy.so.1 (0x7f690624e000)
	libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x7f6906076000)
	libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x7f690605d000)
	libc.musl-x86_64.so.1 => /lib/ld-musl-x86_64.so.1 (0x7f6906c02000)
	libnghttp2.so.14 => /usr/lib/libnghttp2.so.14 (0x7f6906038000)
	libbrotlidec.so.1 => /usr/lib/libbrotlidec.so.1 (0x7f690602c000)
	libbrotlicommon.so.1 => /usr/lib/libbrotlicommon.so.1 (0x7f6906009000)
/ # python3

Python 3.10.3 (main, Apr  7 2022, 10:35:47) [GCC 11.2.1 20220219] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pulsar
>>> dir(pulsar)
['AlreadyClosed', 'Authentication', 'AuthenticationAthenz', 'AuthenticationError', 'AuthenticationOauth2', 'AuthenticationTLS', 'AuthenticationToken', 'AuthorizationError', 'BatchingType', 'BrokerMetadataError', 'BrokerPersistenceError', 'ChecksumError', 'Client', 'CompressionType', 'ConnectError', 'Consumer', 'ConsumerAssignError', 'ConsumerBusy', 'ConsumerNotFound', 'ConsumerNotInitialized', 'ConsumerType', 'Context', 'CryptoError', 'CryptoKeyReader', 'CumulativeAcknowledgementNotAllowedError', 'ErrorGettingAuthenticationData', 'Function', 'IdentitySerDe', 'IncompatibleSchema', 'InitialPosition', 'InvalidConfiguration', 'InvalidMessage', 'InvalidTopicName', 'InvalidTxnStatusError', 'InvalidUrl', 'LookupError', 'MemoryBufferIsFull', 'Message', 'MessageBatch', 'MessageId', 'MessageTooBig', 'NotAllowedError', 'NotConnected', 'OperationNotSupported', 'PartitionsRoutingMode', 'PickleSerDe', 'Producer', 'ProducerBlockedQuotaExceededError', 'ProducerBlockedQuotaExceededException', 'ProducerBusy', 'ProducerFenced', 'ProducerNotInitialized', 'ProducerQueueIsFull', 'PulsarException', 'ReadError', 'Reader', 'Result', 'SerDe', 'ServiceUnitNotReady', 'SubscriptionNotFound', 'Timeout', 'TooManyLookupRequestException', 'TopicNotFound', 'TopicTerminated', 'TransactionConflict', 'TransactionCoordinatorNotFoundError', 'TransactionNotFound', 'UnknownError', 'UnsupportedVersionError', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '_check_type', '_check_type_or_none', '_listener_wrapper', '_pulsar', '_retype', '_schema', 'certifi', 'exceptions', 'functions', 'logging', 're', 'schema', 'timedelta']
>>> 

JanVosNL avatar Apr 09 '22 04:04 JanVosNL