summaryrefslogtreecommitdiff
path: root/dev-python/cmd2
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/cmd2')
-rw-r--r--dev-python/cmd2/cmd2-2.4.1.ebuild12
-rw-r--r--dev-python/cmd2/files/cmd2-2.4.1-py311.patch26
2 files changed, 35 insertions, 3 deletions
diff --git a/dev-python/cmd2/cmd2-2.4.1.ebuild b/dev-python/cmd2/cmd2-2.4.1.ebuild
index f804db5eab53..9ca81d0feaaf 100644
--- a/dev-python/cmd2/cmd2-2.4.1.ebuild
+++ b/dev-python/cmd2/cmd2-2.4.1.ebuild
@@ -9,7 +9,10 @@ PYTHON_COMPAT=( python3_{7,8,9,10} )
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"
@@ -27,12 +30,11 @@ RDEPEND="
# pygtk, xclip, xsel, klipper, qtpy, pyqt5, pyqt4.
# klipper is known to be broken in Xvfb, and therefore causes test
# failures. to avoid them, we must ensure that one of the backends
-# preferred to it is available (i.e. xclip or xsel) + which(1).
+# preferred to it is available (i.e. xclip or xsel).
BDEPEND="
dev-python/setuptools_scm[${PYTHON_USEDEP}]
test? (
dev-python/pytest-mock[${PYTHON_USEDEP}]
- sys-apps/which
|| (
x11-misc/xclip
x11-misc/xsel
@@ -42,6 +44,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]