1 |
commit: 6fc9bf39382407a485ddc3732a28587dc64de04e |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat May 21 13:45:29 2022 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat May 21 13:49:13 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6fc9bf39 |
7 |
|
8 |
dev-python/cmd2: Enable py3.11 |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
dev-python/cmd2/cmd2-2.4.1.ebuild | 11 +++++++++-- |
13 |
dev-python/cmd2/files/cmd2-2.4.1-py311.patch | 26 ++++++++++++++++++++++++++ |
14 |
2 files changed, 35 insertions(+), 2 deletions(-) |
15 |
|
16 |
diff --git a/dev-python/cmd2/cmd2-2.4.1.ebuild b/dev-python/cmd2/cmd2-2.4.1.ebuild |
17 |
index b3c095fe347b..3ffe96f16981 100644 |
18 |
--- a/dev-python/cmd2/cmd2-2.4.1.ebuild |
19 |
+++ b/dev-python/cmd2/cmd2-2.4.1.ebuild |
20 |
@@ -4,12 +4,15 @@ |
21 |
EAPI=8 |
22 |
|
23 |
DISTUTILS_USE_PEP517=setuptools |
24 |
-PYTHON_COMPAT=( python3_{8..10} ) |
25 |
+PYTHON_COMPAT=( python3_{8..11} ) |
26 |
|
27 |
inherit distutils-r1 virtualx |
28 |
|
29 |
DESCRIPTION="Extra features for standard library's cmd module" |
30 |
-HOMEPAGE="https://github.com/python-cmd2/cmd2" |
31 |
+HOMEPAGE=" |
32 |
+ https://github.com/python-cmd2/cmd2/ |
33 |
+ https://pypi.org/project/cmd2/ |
34 |
+" |
35 |
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" |
36 |
|
37 |
LICENSE="MIT" |
38 |
@@ -42,6 +45,10 @@ BDEPEND=" |
39 |
|
40 |
distutils_enable_tests pytest |
41 |
|
42 |
+PATCHES=( |
43 |
+ "${FILESDIR}"/${P}-py311.patch |
44 |
+) |
45 |
+ |
46 |
src_prepare() { |
47 |
distutils-r1_src_prepare |
48 |
sed -i -e '/--cov/d' setup.cfg || die |
49 |
|
50 |
diff --git a/dev-python/cmd2/files/cmd2-2.4.1-py311.patch b/dev-python/cmd2/files/cmd2-2.4.1-py311.patch |
51 |
new file mode 100644 |
52 |
index 000000000000..c0e9da528a08 |
53 |
--- /dev/null |
54 |
+++ b/dev-python/cmd2/files/cmd2-2.4.1-py311.patch |
55 |
@@ -0,0 +1,26 @@ |
56 |
+From c02bb7dce587886fe380704a8c6a6009eb677a74 Mon Sep 17 00:00:00 2001 |
57 |
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@g.o> |
58 |
+Date: Sat, 21 May 2022 15:41:11 +0200 |
59 |
+Subject: [PATCH] Fixed duplicate subparser name in |
60 |
+ test_add_parser_custom_completer |
61 |
+ |
62 |
+If I'm not mistaken, the use of the same name for both subparsers was |
63 |
+not intentional but a typo. In Python 3.11, this is an error and causes |
64 |
+the test to fail. |
65 |
+ |
66 |
+Fixes #1228 |
67 |
+--- |
68 |
+ tests/test_argparse_completer.py | 2 +- |
69 |
+ 1 file changed, 1 insertion(+), 1 deletion(-) |
70 |
+ |
71 |
+diff --git a/tests/test_argparse_completer.py b/tests/test_argparse_completer.py |
72 |
+index 135d3de4..14c8c1de 100644 |
73 |
+--- a/tests/test_argparse_completer.py |
74 |
++++ b/tests/test_argparse_completer.py |
75 |
+@@ -1371,5 +1371,5 @@ def test_add_parser_custom_completer(): |
76 |
+ no_custom_completer_parser = subparsers.add_parser(name="no_custom_completer") |
77 |
+ assert no_custom_completer_parser.get_ap_completer_type() is None # type: ignore[attr-defined] |
78 |
+ |
79 |
+- custom_completer_parser = subparsers.add_parser(name="no_custom_completer", ap_completer_type=CustomCompleter) |
80 |
++ custom_completer_parser = subparsers.add_parser(name="custom_completer", ap_completer_type=CustomCompleter) |
81 |
+ assert custom_completer_parser.get_ap_completer_type() is CustomCompleter # type: ignore[attr-defined] |