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

commit:     47a4311d8ac7d963e5e27ba7f42b329c9adde88e
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun May 11 19:56:36 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun May 11 20:01:21 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=47a4311d

dev-python/lark: enable py3.14

Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-python/lark/files/lark-1.2.2-py314.patch | 38 ++++++++++++++++++++++++++++
 dev-python/lark/lark-1.2.2.ebuild            |  7 ++++-
 2 files changed, 44 insertions(+), 1 deletion(-)

diff --git a/dev-python/lark/files/lark-1.2.2-py314.patch b/dev-python/lark/files/lark-1.2.2-py314.patch
new file mode 100644
index 000000000000..aade3ae30229
--- /dev/null
+++ b/dev-python/lark/files/lark-1.2.2-py314.patch
@@ -0,0 +1,38 @@
+https://github.com/lark-parser/lark/issues/1480
+https://github.com/lark-parser/lark/pull/1483
+
+From 4809ce89ca005b71f6db930c4aabf6496a502795 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= <thrnciar@redhat.com>
+Date: Wed, 6 Nov 2024 16:47:11 +0100
+Subject: [PATCH] Wrap functools.partial in staticmethod() to add compatibility
+ with Python 3.14
+
+Fixes: #1480
+---
+ tests/test_trees.py | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/tests/test_trees.py b/tests/test_trees.py
+index 1f69869e..07687ac0 100644
+--- a/tests/test_trees.py
++++ b/tests/test_trees.py
+@@ -254,7 +254,7 @@ def ab_method(self, a, b):
+             ab_partialmethod = partialmethod(ab_for_partialmethod, 1)
+             set_union = set(["a"]).union
+             static_add = staticmethod(add)
+-            partial_reduce_mul = partial(reduce, mul)
++            partial_reduce_mul = staticmethod(partial(reduce, mul))
+ 
+             custom_callable = CustomCallable()
+ 
+@@ -355,8 +355,8 @@ def test(prefix, s, postfix):
+ 
+         @v_args(inline=True)
+         class T(Transformer):
+-            a = functools.partial(test, "@", postfix="!")
+-            b = functools.partial(lambda s: s + "!")
++            a = staticmethod(functools.partial(test, "@", postfix="!"))
++            b = staticmethod(functools.partial(lambda s: s + "!"))
+ 
+         res = T().transform(tree)
+         assert res.children == ["@TEST1!", "test2!"]

diff --git a/dev-python/lark/lark-1.2.2.ebuild b/dev-python/lark/lark-1.2.2.ebuild
index 4ce565bfc04c..a8a5dd0e749d 100644
--- a/dev-python/lark/lark-1.2.2.ebuild
+++ b/dev-python/lark/lark-1.2.2.ebuild
@@ -4,7 +4,7 @@
 EAPI=8
 
 DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( python3_{10..13} pypy3 pypy3_11 )
+PYTHON_COMPAT=( python3_{11..14} pypy3_11 )
 
 inherit distutils-r1 pypi
 
@@ -28,6 +28,11 @@ BDEPEND="
 	)
 "
 
+PATCHES=(
+	# https://github.com/lark-parser/lark/pull/1483
+	"${FILESDIR}"/${P}-py314.patch
+)
+
 distutils_enable_tests pytest
 
 python_test() {


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

only message in thread, other threads:[~2025-05-11 20:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-11 20:03 [gentoo-commits] repo/gentoo:master commit in: dev-python/lark/, dev-python/lark/files/ Sam James

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