diff --git a/python-311.patch b/python-311.patch new file mode 100644 index 0000000..812de76 --- /dev/null +++ b/python-311.patch @@ -0,0 +1,31 @@ +From cca513e3f511834e8f8c833a619ee8d7fa1b0ee1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20Van=C4=9Bk?= +Date: Fri, 10 Mar 2023 14:24:06 +0100 +Subject: [PATCH] Fix tests for Py3.11 + +--- + test/test_assignors.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/test/test_assignors.py b/test/test_assignors.py +index 67e91e131..a1214d8fa 100644 +--- a/test/test_assignors.py ++++ b/test/test_assignors.py +@@ -661,7 +661,7 @@ def test_reassignment_with_random_subscriptions_and_changes(mocker, execution_nu + + subscriptions = defaultdict(set) + for i in range(n_consumers): +- topics_sample = sample(all_topics, randint(1, len(all_topics) - 1)) ++ topics_sample = sample(sorted(all_topics), randint(1, len(all_topics) - 1)) + subscriptions['C{}'.format(i)].update(topics_sample) + + member_metadata = make_member_metadata(subscriptions) +@@ -671,7 +671,7 @@ def test_reassignment_with_random_subscriptions_and_changes(mocker, execution_nu + + subscriptions = defaultdict(set) + for i in range(n_consumers): +- topics_sample = sample(all_topics, randint(1, len(all_topics) - 1)) ++ topics_sample = sample(sorted(all_topics), randint(1, len(all_topics) - 1)) + subscriptions['C{}'.format(i)].update(topics_sample) + + member_metadata = {} diff --git a/python-kafka-python.changes b/python-kafka-python.changes index 82abca8..a7fecf6 100644 --- a/python-kafka-python.changes +++ b/python-kafka-python.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Apr 10 11:36:09 UTC 2023 - Daniel Garcia + +- Add python-311.patch to fix tests for py3.11 gh#dpkp/kafka-python#2358 + ------------------------------------------------------------------- Wed Oct 12 02:26:13 UTC 2022 - Steve Kowalik diff --git a/python-kafka-python.spec b/python-kafka-python.spec index 9f7bf35..9086d1e 100644 --- a/python-kafka-python.spec +++ b/python-kafka-python.spec @@ -1,7 +1,7 @@ # # spec file for package python-kafka-python # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,7 +16,6 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-kafka-python Version: 2.0.2 Release: 0 @@ -31,6 +30,8 @@ Source3: https://raw.githubusercontent.com/dpkp/kafka-python/master/test/ 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 BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros