summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2022-05-21 15:45:29 +0200
committerMichał Górny <mgorny@gentoo.org>2022-05-21 15:49:13 +0200
commit6fc9bf39382407a485ddc3732a28587dc64de04e (patch)
tree3b6ffce5b5688201ef2a72e28a9bbcdd78fee52f /dev-python/cmd2
parentdev-python/pyperclip: Remove obsolete dep on sys-apps/which (diff)
downloadgentoo-6fc9bf39382407a485ddc3732a28587dc64de04e.tar.gz
gentoo-6fc9bf39382407a485ddc3732a28587dc64de04e.tar.bz2
gentoo-6fc9bf39382407a485ddc3732a28587dc64de04e.zip
dev-python/cmd2: Enable py3.11
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/cmd2')
-rw-r--r--dev-python/cmd2/cmd2-2.4.1.ebuild11
-rw-r--r--dev-python/cmd2/files/cmd2-2.4.1-py311.patch26
2 files changed, 35 insertions, 2 deletions
diff --git a/dev-python/cmd2/cmd2-2.4.1.ebuild b/dev-python/cmd2/cmd2-2.4.1.ebuild
index b3c095fe347b..3ffe96f16981 100644
--- a/dev-python/cmd2/cmd2-2.4.1.ebuild
+++ b/dev-python/cmd2/cmd2-2.4.1.ebuild
@@ -4,12 +4,15 @@
EAPI=8
DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( python3_{8..10} )
+PYTHON_COMPAT=( python3_{8..11} )
inherit distutils-r1 virtualx
DESCRIPTION="Extra features for standard library's cmd module"
-HOMEPAGE="https://github.com/python-cmd2/cmd2"
+HOMEPAGE="
+ https://github.com/python-cmd2/cmd2/
+ https://pypi.org/project/cmd2/
+"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
LICENSE="MIT"
@@ -42,6 +45,10 @@ BDEPEND="
distutils_enable_tests pytest
+PATCHES=(
+ "${FILESDIR}"/${P}-py311.patch
+)
+
src_prepare() {
distutils-r1_src_prepare
sed -i -e '/--cov/d' setup.cfg || die
diff --git a/dev-python/cmd2/files/cmd2-2.4.1-py311.patch b/dev-python/cmd2/files/cmd2-2.4.1-py311.patch
new file mode 100644
index 000000000000..c0e9da528a08
--- /dev/null
+++ b/dev-python/cmd2/files/cmd2-2.4.1-py311.patch
@@ -0,0 +1,26 @@
+From c02bb7dce587886fe380704a8c6a6009eb677a74 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Sat, 21 May 2022 15:41:11 +0200
+Subject: [PATCH] Fixed duplicate subparser name in
+ test_add_parser_custom_completer
+
+If I'm not mistaken, the use of the same name for both subparsers was
+not intentional but a typo. In Python 3.11, this is an error and causes
+the test to fail.
+
+Fixes #1228
+---
+ tests/test_argparse_completer.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/test_argparse_completer.py b/tests/test_argparse_completer.py
+index 135d3de4..14c8c1de 100644
+--- a/tests/test_argparse_completer.py
++++ b/tests/test_argparse_completer.py
+@@ -1371,5 +1371,5 @@ def test_add_parser_custom_completer():
+ no_custom_completer_parser = subparsers.add_parser(name="no_custom_completer")
+ assert no_custom_completer_parser.get_ap_completer_type() is None # type: ignore[attr-defined]
+
+- custom_completer_parser = subparsers.add_parser(name="no_custom_completer", ap_completer_type=CustomCompleter)
++ custom_completer_parser = subparsers.add_parser(name="custom_completer", ap_completer_type=CustomCompleter)
+ assert custom_completer_parser.get_ap_completer_type() is CustomCompleter # type: ignore[attr-defined]