summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Schmaus <flow@gentoo.org>2021-10-20 12:16:23 +0200
committerFlorian Schmaus <flow@gentoo.org>2021-10-20 12:17:20 +0200
commit6a4820a324f299ce5600145c1b38e455371a0866 (patch)
tree2fe37ac82b726f026e0feafdeb2d448726050807 /dev-python/pdoc3
parentapp-emulation/xen-tools: drop unused flask use flag (diff)
downloadgentoo-6a4820a324f299ce5600145c1b38e455371a0866.tar.gz
gentoo-6a4820a324f299ce5600145c1b38e455371a0866.tar.bz2
gentoo-6a4820a324f299ce5600145c1b38e455371a0866.zip
dev-python/pdoc3: add testsuite patch for Python 3.9 compat
Closes: https://bugs.gentoo.org/808603 Signed-off-by: Florian Schmaus <flow@gentoo.org>
Diffstat (limited to 'dev-python/pdoc3')
-rw-r--r--dev-python/pdoc3/files/pdoc3-TST-use-explicit-ClassWithNew-instead-of-typing.Gene.patch43
-rw-r--r--dev-python/pdoc3/pdoc3-0.10.0.ebuild4
2 files changed, 47 insertions, 0 deletions
diff --git a/dev-python/pdoc3/files/pdoc3-TST-use-explicit-ClassWithNew-instead-of-typing.Gene.patch b/dev-python/pdoc3/files/pdoc3-TST-use-explicit-ClassWithNew-instead-of-typing.Gene.patch
new file mode 100644
index 000000000000..b969bf4727bc
--- /dev/null
+++ b/dev-python/pdoc3/files/pdoc3-TST-use-explicit-ClassWithNew-instead-of-typing.Gene.patch
@@ -0,0 +1,43 @@
+From 4aa70de2221a34a3003a7e5f52a9b91965f0e359 Mon Sep 17 00:00:00 2001
+From: Spencer Baugh <sbaugh@catern.com>
+Date: Thu, 23 Sep 2021 09:00:25 -0400
+Subject: [PATCH] TST: use explicit ClassWithNew instead of typing.Generic
+
+typing.Generic doesn't have a __new__ method in 3.9.
+
+Fixes https://github.com/pdoc3/pdoc/issues/355
+---
+ pdoc/test/__init__.py | 10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/pdoc/test/__init__.py b/pdoc/test/__init__.py
+index e8c3d94a805b..8b67ab77d3f7 100644
+--- a/pdoc/test/__init__.py
++++ b/pdoc/test/__init__.py
+@@ -1043,16 +1043,20 @@ class Foo:
+
+ self.assertEqual(pdoc.Class('C2', mod, C2).params(), ['a', 'b', 'c=None', '*', 'd=1', 'e'])
+
+- class G(typing.Generic[T]):
++ class ClassWithNew:
++ def __new__(self, arg):
++ pass
++
++ class G(ClassWithNew):
+ def __init__(self, a, b, c=100):
+ pass
+
+ self.assertEqual(pdoc.Class('G', mod, G).params(), ['a', 'b', 'c=100'])
+
+- class G2(typing.Generic[T]):
++ class G2(ClassWithNew):
+ pass
+
+- self.assertEqual(pdoc.Class('G2', mod, G2).params(), ['*args', '**kwds'])
++ self.assertEqual(pdoc.Class('G2', mod, G2).params(), ['arg'])
+
+ def test_url(self):
+ mod = pdoc.Module(EXAMPLE_MODULE)
+--
+2.32.0
+
diff --git a/dev-python/pdoc3/pdoc3-0.10.0.ebuild b/dev-python/pdoc3/pdoc3-0.10.0.ebuild
index 7769b43281fc..5f148c0355d0 100644
--- a/dev-python/pdoc3/pdoc3-0.10.0.ebuild
+++ b/dev-python/pdoc3/pdoc3-0.10.0.ebuild
@@ -21,6 +21,10 @@ RDEPEND="
"
DEPEND="${RDEPEND}"
+PATCHES=(
+ "${FILESDIR}/${PN}-TST-use-explicit-ClassWithNew-instead-of-typing.Gene.patch"
+)
+
python_prepare_all() {
distutils-r1_python_prepare_all
sed -i \