14
0

Accepting request 1001490 from home:jayvdb:branches:devel:languages:python

- Add test files missing from PyPI release:
  conftest.py, fixtures.py, service.py & zookeeper.properties
- Activate test suite

OBS-URL: https://build.opensuse.org/request/show/1001490
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-kafka-python?expand=0&rev=21
This commit is contained in:
2022-09-06 18:58:49 +00:00
committed by Git OBS Bridge
parent 371fab1f10
commit b939117e3e
6 changed files with 1038 additions and 5 deletions

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-kafka-python
#
# Copyright (c) 2020 SUSE LLC
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -25,12 +25,27 @@ 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
Source4: https://raw.githubusercontent.com/dpkp/kafka-python/master/test/service.py
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module six}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-six
# Recommends: python-crc32c # Not packaged
Recommends: python-zstandard
Suggests: python-lz4
Suggests: python-xxhash
BuildArch: noarch
# SECTION test requirements
BuildRequires: %{python_module lz4}
BuildRequires: %{python_module mock}
BuildRequires: %{python_module pytest-mock}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module python-snappy}
BuildRequires: %{python_module xxhash}
BuildRequires: %{python_module zstandard}
# /SECTION
%python_subpackages
%description
@@ -41,6 +56,12 @@ is also supported for message sets.
%prep
%setup -q -n kafka-python-%{version}
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
@@ -49,10 +70,13 @@ is also supported for message sets.
%python_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)'
%files %{python_files}
%license LICENSE
%doc README.rst
%{python_sitelib}/*
%exclude %{python_sitelib}/tests/
%{python_sitelib}/kafka*/
%changelog