Gentoo Archives: gentoo-commits

From: Florian Schmaus <flow@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pdoc3/, dev-python/pdoc3/files/
Date: Wed, 20 Oct 2021 10:17:32
Message-Id: 1634725040.6a4820a324f299ce5600145c1b38e455371a0866.flow@gentoo
1 commit: 6a4820a324f299ce5600145c1b38e455371a0866
2 Author: Florian Schmaus <flow <AT> gentoo <DOT> org>
3 AuthorDate: Wed Oct 20 10:16:23 2021 +0000
4 Commit: Florian Schmaus <flow <AT> gentoo <DOT> org>
5 CommitDate: Wed Oct 20 10:17:20 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6a4820a3
7
8 dev-python/pdoc3: add testsuite patch for Python 3.9 compat
9
10 Closes: https://bugs.gentoo.org/808603
11 Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>
12
13 ...licit-ClassWithNew-instead-of-typing.Gene.patch | 43 ++++++++++++++++++++++
14 dev-python/pdoc3/pdoc3-0.10.0.ebuild | 4 ++
15 2 files changed, 47 insertions(+)
16
17 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
18 new file mode 100644
19 index 00000000000..b969bf4727b
20 --- /dev/null
21 +++ b/dev-python/pdoc3/files/pdoc3-TST-use-explicit-ClassWithNew-instead-of-typing.Gene.patch
22 @@ -0,0 +1,43 @@
23 +From 4aa70de2221a34a3003a7e5f52a9b91965f0e359 Mon Sep 17 00:00:00 2001
24 +From: Spencer Baugh <sbaugh@××××××.com>
25 +Date: Thu, 23 Sep 2021 09:00:25 -0400
26 +Subject: [PATCH] TST: use explicit ClassWithNew instead of typing.Generic
27 +
28 +typing.Generic doesn't have a __new__ method in 3.9.
29 +
30 +Fixes https://github.com/pdoc3/pdoc/issues/355
31 +---
32 + pdoc/test/__init__.py | 10 +++++++---
33 + 1 file changed, 7 insertions(+), 3 deletions(-)
34 +
35 +diff --git a/pdoc/test/__init__.py b/pdoc/test/__init__.py
36 +index e8c3d94a805b..8b67ab77d3f7 100644
37 +--- a/pdoc/test/__init__.py
38 ++++ b/pdoc/test/__init__.py
39 +@@ -1043,16 +1043,20 @@ class Foo:
40 +
41 + self.assertEqual(pdoc.Class('C2', mod, C2).params(), ['a', 'b', 'c=None', '*', 'd=1', 'e'])
42 +
43 +- class G(typing.Generic[T]):
44 ++ class ClassWithNew:
45 ++ def __new__(self, arg):
46 ++ pass
47 ++
48 ++ class G(ClassWithNew):
49 + def __init__(self, a, b, c=100):
50 + pass
51 +
52 + self.assertEqual(pdoc.Class('G', mod, G).params(), ['a', 'b', 'c=100'])
53 +
54 +- class G2(typing.Generic[T]):
55 ++ class G2(ClassWithNew):
56 + pass
57 +
58 +- self.assertEqual(pdoc.Class('G2', mod, G2).params(), ['*args', '**kwds'])
59 ++ self.assertEqual(pdoc.Class('G2', mod, G2).params(), ['arg'])
60 +
61 + def test_url(self):
62 + mod = pdoc.Module(EXAMPLE_MODULE)
63 +--
64 +2.32.0
65 +
66
67 diff --git a/dev-python/pdoc3/pdoc3-0.10.0.ebuild b/dev-python/pdoc3/pdoc3-0.10.0.ebuild
68 index 7769b43281f..5f148c0355d 100644
69 --- a/dev-python/pdoc3/pdoc3-0.10.0.ebuild
70 +++ b/dev-python/pdoc3/pdoc3-0.10.0.ebuild
71 @@ -21,6 +21,10 @@ RDEPEND="
72 "
73 DEPEND="${RDEPEND}"
74
75 +PATCHES=(
76 + "${FILESDIR}/${PN}-TST-use-explicit-ClassWithNew-instead-of-typing.Gene.patch"
77 +)
78 +
79 python_prepare_all() {
80 distutils-r1_python_prepare_all
81 sed -i \