# # spec file for package python-pulsar-client # # Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # %global flavor @BUILD_FLAVOR@%{nil} %if "%{flavor}" == "test" %define psuffix -test %bcond_without test %else %define psuffix %{nil} %bcond_with test %endif # pulsar-client-cpp doesn't build for 32bit architectures ExcludeArch: %{ix86} %{arm32} %{?sle15_python_module_pythons} Name: python-pulsar-client%{psuffix} Version: 3.5.0 Release: 0 Group: Development/Libraries/Python Summary: Apache Pulsar Python client library License: Apache-2.0 URL: https://github.com/apache/pulsar-client-python Source: https://github.com/apache/pulsar-client-python/archive/refs/tags/v3.5.0.tar.xz#/pulsar-client-python-3.5.0.tar.xz # PATCH-FIX-OPENSUSE cmake_use_specific_python_version.patch Patch0: cmake_use_specific_python_version.patch # PATCH-FIX-OPENSUSE setup_copy_python_versioned_so_file.patch Patch1: setup_copy_python_versioned_so_file.patch Requires: %{python_flavor}-certifi Recommends: %{python_flavor}-apache-bookkeeper-client >= 4.16.1 Recommends: %{python_flavor}-fastavro >= 1.9.2 Recommends: %{python_flavor}-grpcio >= 1.60.0 Recommends: %{python_flavor}-prometheus-client Recommends: %{python_flavor}-protobuf >= 3.6.1 Recommends: %{python_flavor}-ratelimit BuildRequires: c++_compiler BuildRequires: cmake BuildRequires: fdupes BuildRequires: protobuf-devel BuildRequires: pulsar-client-cpp-devel BuildRequires: %{python_module pip} BuildRequires: %{python_module pybind11-devel} BuildRequires: %{python_module pybind11} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module wheel} %if %{with test} # SECTION test requirements BuildRequires: %{python_module fastavro >= 1.9.7} BuildRequires: %{python_module pytest-xdist} BuildRequires: %{python_module pytest} BuildRequires: %{python_module pulsar-client = %{version}} BuildRequires: %{python_module requests} # /SECTION %endif %python_subpackages %description Pulsar Python clients support a variety of Pulsar features to enable building applications connecting to your Pulsar cluster. %prep %autosetup -p1 -n pulsar-client-python-%{version} %build %if %{without test} %{python_expand # this will expand the following steps %cmake \ -DCMAKE_BUILD_TYPE=Release \ -DUSE_PYTHON_VERSION=%{$python_version} \ %{nil} %cmake_build # the python setup.py build step below expects to find # an appropriately named library file in the top level # directory so copy the built lib_pulsar.so to a python # versioned name so that the correct file is used when # building for multiple python versions. cp lib_pulsar.so ../lib_pulsar%{$python_version}.so cd .. } %python_build %endif %install %if %{without test} %python_install %python_expand %fdupes %{buildroot}%{$python_sitearch} %endif %check %if %{with test} # disable tests that fail due to lack of network connectivity donttest="(AsyncioTest and test_batch_send) or " donttest+="(AsyncioTest and test_close_producer) or " donttest+="(AsyncioTest and test_create_producer_failure) or " donttest+="(AsyncioTest and test_send_failure) or " donttest+="(CustomLoggingTest and test_async_func_with_custom_logger) or " donttest+="(InterruptedTest and test_sigint) or " donttest+="(Oauth2Test and test_base64) or " donttest+="(Oauth2Test and test_invalid_private_key) or " donttest+="(Oauth2Test and test_key_file) or " donttest+="(Oauth2Test and test_wrong_secret) or " donttest+="(SchemaTest and test_avro_enum) or " donttest+="(SchemaTest and test_avro_map_array) or " donttest+="(SchemaTest and test_avro_required_default) or " donttest+="(SchemaTest and test_avro_schema) or " donttest+="(SchemaTest and test_bytes_schema) or " donttest+="(SchemaTest and test_default_value) or " donttest+="(SchemaTest and test_json_enum) or " donttest+="(SchemaTest and test_json_schema) or " donttest+="(SchemaTest and test_produce_and_consume_complex_schema_data) or " donttest+="(SchemaTest and test_schema_evolve) or " donttest+="(SchemaTest and test_schema_type_promotion) or " donttest+="(SchemaTest and test_schema_version) or " donttest+="(SchemaTest and test_string_schema) or " donttest+="(ReaderTest and test_has_message_available_after_seek) or " donttest+="(ReaderTest and test_seek_latest_message_id) or " donttest+="(PulsarTest and test_acknowledge_failed) or " donttest+="(PulsarTest and test_basic_auth) or " donttest+="(PulsarTest and test_basic_auth_method) or " donttest+="(PulsarTest and test_batch_index_ack) or " donttest+="(PulsarTest and test_batch_receive) or " donttest+="(PulsarTest and test_chunking) or " donttest+="(PulsarTest and test_client_reference_deleted) or " donttest+="(PulsarTest and test_configure_log_level) or " donttest+="(PulsarTest and test_configure_log_to_file) or " donttest+="(PulsarTest and test_connect_timeout) or " donttest+="(PulsarTest and test_consumer_initial_position) or " donttest+="(PulsarTest and test_consumer_is_connected) or " donttest+="(PulsarTest and test_consumer_name) or " donttest+="(PulsarTest and test_consumer_queue_size_is_zero) or " donttest+="(PulsarTest and test_dead_letter_policy) or " donttest+="(PulsarTest and test_deliver_after) or " donttest+="(PulsarTest and test_deliver_at) or " donttest+="(PulsarTest and test_encryption) or " donttest+="(PulsarTest and test_get_last_message_id) or " donttest+="(PulsarTest and test_get_partitioned_topic_name) or " donttest+="(PulsarTest and test_get_topic_name) or " donttest+="(PulsarTest and test_get_topics_partitions) or " donttest+="(PulsarTest and test_invalid_basic_auth) or " donttest+="(PulsarTest and test_keyshared_autosplit) or " donttest+="(PulsarTest and test_logger_thread_leaks) or " donttest+="(PulsarTest and test_message_argument_errors) or " donttest+="(PulsarTest and test_message_listener) or " donttest+="(PulsarTest and test_message_properties) or " donttest+="(PulsarTest and test_negative_acks) or " donttest+="(PulsarTest and test_ordering_key) or " donttest+="(PulsarTest and test_producer_access_mode_exclusive) or " donttest+="(PulsarTest and test_producer_access_mode_exclusive_with_fencing) or " donttest+="(PulsarTest and test_producer_access_mode_wait_exclusive) or " donttest+="(PulsarTest and test_producer_consumer) or " donttest+="(PulsarTest and test_producer_consumer_zstd) or " donttest+="(PulsarTest and test_producer_deduplication) or " donttest+="(PulsarTest and test_producer_is_connected) or " donttest+="(PulsarTest and test_producer_routing_mode) or " donttest+="(PulsarTest and test_producer_send) or " donttest+="(PulsarTest and test_producer_send_async) or " donttest+="(PulsarTest and test_producer_sequence_after_reconnection) or " donttest+="(PulsarTest and test_publish_compact_and_consume) or " donttest+="(PulsarTest and test_reader_argument_errors) or " donttest+="(PulsarTest and test_reader_has_message_available) or " donttest+="(PulsarTest and test_reader_is_connected) or " donttest+="(PulsarTest and test_reader_on_last_message) or " donttest+="(PulsarTest and test_reader_on_partitioned_topic) or " donttest+="(PulsarTest and test_reader_on_specific_message) or " donttest+="(PulsarTest and test_reader_on_specific_message_with_batches) or " donttest+="(PulsarTest and test_reader_seek_for_message_id) or " donttest+="(PulsarTest and test_reader_simple) or " donttest+="(PulsarTest and test_redelivery_count) or " donttest+="(PulsarTest and test_regex_subscription) or " donttest+="(PulsarTest and test_seek) or " donttest+="(PulsarTest and test_seek_inclusive) or " donttest+="(PulsarTest and test_send_async_no_deadlock) or " donttest+="(PulsarTest and test_shutdown_client) or " donttest+="(PulsarTest and test_simple_producer) or " donttest+="(PulsarTest and test_sticky_autosplit) or " donttest+="(PulsarTest and test_tls_auth) or " donttest+="(PulsarTest and test_tls_auth2) or " donttest+="(PulsarTest and test_tls_auth3) or " donttest+="(PulsarTest and test_token_auth) or " donttest+="(PulsarTest and test_token_auth_supplier) or " donttest+="(PulsarTest and test_topics_consumer) or " donttest+="(PulsarTest and test_topics_pattern_consumer) or " donttest+="(PulsarTest and test_v2_topics) or " donttest+="(PulsarTest and test_v2_topics_http) or " donttest+="(ReaderTest and test_has_message_available_after_seek) or " donttest+="(ReaderTest and test_seek_latest_message_id) or " donttest+="(SchemaTest and test_avro_enum) or " donttest+="(SchemaTest and test_avro_map_array) or " donttest+="(SchemaTest and test_avro_required_default) or " donttest+="(SchemaTest and test_avro_schema) or " donttest+="(SchemaTest and test_bytes_schema) or " donttest+="(SchemaTest and test_default_value) or " donttest+="(SchemaTest and test_json_enum) or " donttest+="(SchemaTest and test_json_schema) or " donttest+="(SchemaTest and test_produce_and_consume_complex_schema_data) or " donttest+="(SchemaTest and test_schema_evolve) or " donttest+="(SchemaTest and test_schema_type_promotion) or " donttest+="(SchemaTest and test_schema_version) or " donttest+="(SchemaTest and test_string_schema)" # reenable tests that can safely run, which may have been inadvertently # disabled by the above donttest patterns dotest+="or (PulsarTest and test_dead_letter_policy_config) " dotest+="or (SchemaTest and test_json_schema_encode_remove_reserved_key)" %pytest -v -k "not ($donttest) ${dotest}" %endif %if %{without test} %files %{python_files} %license LICENSE %doc README.md %{python_sitearch}/_pulsar*.so %{python_sitearch}/pulsar %{python_sitearch}/pulsar_client-%{version}*-info %endif %changelog