14
0

- Add patch slightly-patch-out-six.patch:

* Remove some uses of six, to avoid circular imports.
- Also edit fixutres.py directly for the same reason.
- Switch to pyproject macros.
- Less globs in %files.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-kafka-python?expand=0&rev=28
This commit is contained in:
2024-03-19 04:01:55 +00:00
committed by Git OBS Bridge
parent 61054451df
commit c3cdce0a0d
4 changed files with 73 additions and 12 deletions

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-kafka-python
#
# Copyright (c) 2023 SUSE LLC
# 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
@@ -21,18 +21,21 @@ Version: 2.0.2
Release: 0
Summary: Pure Python client for Apache Kafka
License: Apache-2.0
Group: Development/Languages/Python
URL: https://github.com/mumrah/kafka-python
Source: https://files.pythonhosted.org/packages/source/k/kafka-python/kafka-python-%{version}.tar.gz
Source1: https://raw.githubusercontent.com/dpkp/kafka-python/master/servers/0.11.0.3/resources/zookeeper.properties
Source2: https://raw.githubusercontent.com/dpkp/kafka-python/master/test/conftest.py
Source3: https://raw.githubusercontent.com/dpkp/kafka-python/master/test/fixtures.py
Source3: fixtures.py
Source4: https://raw.githubusercontent.com/dpkp/kafka-python/master/test/service.py
# PATCH-FIX-OPENSUSE Remove use of mock module
Patch0: remove-mock.patch
# PATCH-FIX-UPSTREAM fix tests for py3.11 gh#dpkp/kafka-python#2358
Patch1: python-311.patch
# PATCH-FIX-OPENSUSE Remove circular imports involving vendored modules
Patch2: slightly-patch-out-six.patch
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
# Recommends: python-crc32c # Not packaged
@@ -62,23 +65,24 @@ mkdir -p servers/0.11.0.2/resources/
cp %{SOURCE1} servers/0.11.0.2/resources/
cp %{SOURCE2} %{SOURCE3} %{SOURCE4} test/
touch test/__init__.py
%build
%python_build
%pyproject_wheel
%install
%python_install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
# test_kafka_producer_gc_cleanup is sometimes off by 1
%pytest -rs -k 'not (test_kafka_consumer_offsets_for_time_old or test_kafka_producer_gc_cleanup)'
# test_send broken with Python 3.12
%pytest -rs -k 'not (test_kafka_consumer_offsets_for_time_old or test_kafka_producer_gc_cleanup or test_send)'
%files %{python_files}
%license LICENSE
%doc README.rst
%{python_sitelib}/kafka*/
%{python_sitelib}/kafka
%{python_sitelib}/kafka_python-%{version}.dist-info
%changelog