public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-python/kafka-python/files/, dev-python/kafka-python/
@ 2023-03-10 13:55 Sam James
  0 siblings, 0 replies; only message in thread
From: Sam James @ 2023-03-10 13:55 UTC (permalink / raw
  To: gentoo-commits

commit:     f96aaa62cb7b6fff5dba9602c37ee8b1553ad3ca
Author:     Petr Vaněk <arkamar <AT> atlas <DOT> cz>
AuthorDate: Fri Mar 10 12:55:48 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Mar 10 13:55:13 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f96aaa62

dev-python/kafka-python: enable py3.11

It was necessary to apply patch to fix tests with py3.11. The patch was
sent to upstream [1].

[1] https://github.com/dpkp/kafka-python/pull/2358

Closes: https://bugs.gentoo.org/896790
Signed-off-by: Petr Vaněk <arkamar <AT> atlas.cz>
Closes: https://github.com/gentoo/gentoo/pull/30043
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../kafka-python-2.0.2-py311-test-fixes.patch      | 26 ++++++++++++++++++++++
 .../kafka-python/kafka-python-2.0.2-r1.ebuild      |  6 ++++-
 2 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/dev-python/kafka-python/files/kafka-python-2.0.2-py311-test-fixes.patch b/dev-python/kafka-python/files/kafka-python-2.0.2-py311-test-fixes.patch
new file mode 100644
index 000000000000..8b983952fd47
--- /dev/null
+++ b/dev-python/kafka-python/files/kafka-python-2.0.2-py311-test-fixes.patch
@@ -0,0 +1,26 @@
+Fix tests for Py3.11
+
+Upstream-PR: https://github.com/dpkp/kafka-python/pull/2358
+
+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/dev-python/kafka-python/kafka-python-2.0.2-r1.ebuild b/dev-python/kafka-python/kafka-python-2.0.2-r1.ebuild
index 911f0ecfa1e6..d0963154542f 100644
--- a/dev-python/kafka-python/kafka-python-2.0.2-r1.ebuild
+++ b/dev-python/kafka-python/kafka-python-2.0.2-r1.ebuild
@@ -4,7 +4,7 @@
 EAPI=8
 
 DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( python3_{9..10} )
+PYTHON_COMPAT=( python3_{9..11} )
 
 inherit distutils-r1 optfeature
 
@@ -35,6 +35,10 @@ BDEPEND="
 	)
 "
 
+PATCHES=(
+	"${FILESDIR}/${P}-py311-test-fixes.patch"
+)
+
 distutils_enable_tests pytest
 
 EPYTEST_DESELECT=(


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-10 13:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-10 13:55 [gentoo-commits] repo/gentoo:master commit in: dev-python/kafka-python/files/, dev-python/kafka-python/ Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox