summaryrefslogtreecommitdiff
path: root/dev-python/argh
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/argh')
-rw-r--r--dev-python/argh/Manifest3
-rw-r--r--dev-python/argh/argh-0.31.2.ebuild8
-rw-r--r--dev-python/argh/files/argh-0.31.2-py313.patch164
3 files changed, 172 insertions, 3 deletions
diff --git a/dev-python/argh/Manifest b/dev-python/argh/Manifest
index fb55fd826775..d4e788c82cec 100644
--- a/dev-python/argh/Manifest
+++ b/dev-python/argh/Manifest
@@ -1,3 +1,4 @@
+AUX argh-0.31.2-py313.patch 5349 BLAKE2B c94408fd5339ee79416dbdc7a680b42636a85cb1214bee5cdabd39db7479c5a7763e0efd23128ac47b882f890c89a9606bdb66a6f8b8a2b1aba31a92c7e9ac68 SHA512 72cc0e2fce6d4801344026177fe94af00ee872799c5b78026e255ef4560b83231630cb5cfa38d47be33d5666a37aff36b72c2ed923b1b4b6d9ca12e75e882eb9
DIST argh-0.31.2.tar.gz 57200 BLAKE2B e5ba440d08d8f5655d237d61ab65fef02296d28d0562945e56dfa6598deafa6cc288d88e625c4acabfa2eeda359f970679db1e7424d77e0278b65fbe15c8b499 SHA512 2e0d926cae88d6830706f631aa2220654777dcc1a4263af889064d4c805616fce368c90e871a393490b9590f82759f56b2434afeba468e7720f99d85c8b75dd1
-EBUILD argh-0.31.2.ebuild 622 BLAKE2B 5c5e5209dfe8cf3896c6ea936506d1f9b3ba0054c1e706a14c4a48bd559f02bf3c57e117f0371f3e45ebfe06fdad0695a3e7cb1bc5c1f49c7c16f27729d274ef SHA512 6d52dd5e6f10d8f8762a5b11d7357482f78c7508a44456d4bc9469b2cf666d39e42a74f90126eb4466bbcf61fa1ee7a243c0d8ca3b69d2ac7d2eeafbdbc7e9c8
+EBUILD argh-0.31.2.ebuild 697 BLAKE2B f0bd982ecca81bc5fd86f67d836a00875d31d16a6f7a4ac44f23e2389e87b2cd76035d83461980cdb975a8b4fff1e8fdf73845fadcf6338631ae724f571a01cd SHA512 0a08705bf387218e0799c889e85745060f3f879b8d67284c6e03131e2559a651abc23b7136996d34a1569eab8f0efe96b789a1ceec07c3ca0b2bf010b6933875
MISC metadata.xml 385 BLAKE2B e1fc25e92c45fbd0183634cc645085fef5223a59975a5000557c1a2ef497c6f9ce017e462a9a881e61b4578c90859f51e5471d197ea884b7dc4ce90786a0987a SHA512 97719df6c0b48c7348bf25de9016dd1de373d6b9e1fd7f52d87eb6e0935608719c726aa3f4ca4aba8fa1211d1234c2b959dd821d241cd65b6cb47b1a06481df6
diff --git a/dev-python/argh/argh-0.31.2.ebuild b/dev-python/argh/argh-0.31.2.ebuild
index fb61d011ee2d..0c53e95bef20 100644
--- a/dev-python/argh/argh-0.31.2.ebuild
+++ b/dev-python/argh/argh-0.31.2.ebuild
@@ -4,8 +4,7 @@
EAPI=8
DISTUTILS_USE_PEP517=flit
-# py3.13: https://github.com/neithere/argh/issues/228
-PYTHON_COMPAT=( python3_{10..12} pypy3 )
+PYTHON_COMPAT=( python3_{10..13} pypy3 )
inherit distutils-r1 pypi
@@ -27,3 +26,8 @@ BDEPEND="
"
distutils_enable_tests pytest
+
+PATCHES=(
+ # https://github.com/neithere/argh/commit/cdb70d5ac7d8a5a5dff3c55100e5f67b68b26826
+ "${FILESDIR}/${P}-py313.patch"
+)
diff --git a/dev-python/argh/files/argh-0.31.2-py313.patch b/dev-python/argh/files/argh-0.31.2-py313.patch
new file mode 100644
index 000000000000..4049fedc0d0d
--- /dev/null
+++ b/dev-python/argh/files/argh-0.31.2-py313.patch
@@ -0,0 +1,164 @@
+From cdb70d5ac7d8a5a5dff3c55100e5f67b68b26826 Mon Sep 17 00:00:00 2001
+From: Andy Mikhaylenko <neithere@gmail.com>
+Date: Sun, 16 Jun 2024 22:38:21 +0200
+Subject: [PATCH] fix: tests under Python 3.13 (fixes #228)
+
+diff --git a/tests/test_integration.py b/tests/test_integration.py
+index f863386..258a148 100644
+--- a/tests/test_integration.py
++++ b/tests/test_integration.py
+@@ -724,18 +724,34 @@ def remind(
+ help_normalised = re.sub(r"\s+", " ", parser.format_help())
+
+ assert "name 'Basil'" in help_normalised
+- assert "-t TASK, --task TASK 'hang the Moose'" in help_normalised
+- assert (
+- "-r REASON, --reason REASON 'there are creatures living in it'"
+- in help_normalised
+- )
+
+- # explicit help message is not obscured by the implicit one
+- # but is still present
+- assert (
+- "-n NOTE, --note NOTE why is it a remarkable animal? "
+- "(default: 'it can speak English')"
+- ) in help_normalised
++ # argh#228 — argparse in Python before 3.13 duplicated the placeholder in help
++ if sys.version_info < (3, 13):
++ assert "-t TASK, --task TASK 'hang the Moose'" in help_normalised
++ assert (
++ "-r REASON, --reason REASON 'there are creatures living in it'"
++ in help_normalised
++ )
++
++ # explicit help message is not obscured by the implicit one
++ # but is still present
++ assert (
++ "-n NOTE, --note NOTE why is it a remarkable animal? "
++ "(default: 'it can speak English')"
++ ) in help_normalised
++ else:
++ assert "-t, --task TASK 'hang the Moose'" in help_normalised
++ assert (
++ "-r, --reason REASON 'there are creatures living in it'"
++ in help_normalised
++ )
++
++ # explicit help message is not obscured by the implicit one
++ # but is still present
++ assert (
++ "-n, --note NOTE why is it a remarkable animal? "
++ "(default: 'it can speak English')"
++ ) in help_normalised
+
+
+ def test_default_arg_values_in_help__regression():
+@@ -750,9 +766,16 @@ def foo(*, bar=""):
+ # doesn't break
+ parser.format_help()
+
++ # argh#228 — argparse in Python before 3.13 duplicated the placeholder in help
++ if sys.version_info < (3, 13):
++ expected_line = "-b BAR, --bar BAR ''"
++ # note the empty str repr ^^^
++ else:
++ expected_line = "-b, --bar BAR ''"
++ # note the empty str repr ^^^
++
+ # now check details
+- assert "-b BAR, --bar BAR ''" in parser.format_help()
+- # note the empty str repr ^^^
++ assert expected_line in parser.format_help()
+
+
+ def test_help_formatting_is_preserved():
+@@ -868,6 +891,19 @@ def second_func():
+
+ run(parser, "first-func --help", exit=True)
+ captured = capsys.readouterr()
++
++ # argh#228 — argparse in Python before 3.13 duplicated the placeholder in help
++ if sys.version_info < (3, 13):
++ arg_help_lines = (
++ " -h, --help show this help message and exit\n"
++ " -f FOO, --foo FOO 123"
++ )
++ else:
++ arg_help_lines = (
++ " -h, --help show this help message and exit\n"
++ " -f, --foo FOO 123"
++ )
++
+ assert (
+ captured.out
+ == unindent(
+@@ -877,8 +913,7 @@ def second_func():
+ Owl stretching time
+
+ {HELP_OPTIONS_LABEL}:
+- -h, --help show this help message and exit
+- -f FOO, --foo FOO 123
++ {arg_help_lines}
+ """
+ )[1:]
+ )
+@@ -997,6 +1032,19 @@ def second_func():
+
+ run(parser, "my-group first-func --help", exit=True)
+ captured = capsys.readouterr()
++
++ # argh#228 — argparse in Python before 3.13 duplicated the placeholder in help
++ if sys.version_info < (3, 13):
++ arg_help_lines = (
++ " -h, --help show this help message and exit\n"
++ " -f FOO, --foo FOO 123"
++ )
++ else:
++ arg_help_lines = (
++ " -h, --help show this help message and exit\n"
++ " -f, --foo FOO 123"
++ )
++
+ assert (
+ captured.out
+ == unindent(
+@@ -1006,8 +1054,7 @@ def second_func():
+ Owl stretching time
+
+ {HELP_OPTIONS_LABEL}:
+- -h, --help show this help message and exit
+- -f FOO, --foo FOO 123
++ {arg_help_lines}
+ """
+ )[1:]
+ )
+@@ -1079,6 +1126,19 @@ def second_func():
+
+ run(parser, "first-func --help", exit=True)
+ captured = capsys.readouterr()
++
++ # argh#228 — argparse in Python before 3.13 duplicated the placeholder in help
++ if sys.version_info < (3, 13):
++ arg_help_lines = (
++ " -h, --help show this help message and exit\n"
++ " -f FOO, --foo FOO 123"
++ )
++ else:
++ arg_help_lines = (
++ " -h, --help show this help message and exit\n"
++ " -f, --foo FOO 123"
++ )
++
+ assert (
+ captured.out
+ == unindent(
+@@ -1088,8 +1148,7 @@ def second_func():
+ func description override
+
+ {HELP_OPTIONS_LABEL}:
+- -h, --help show this help message and exit
+- -f FOO, --foo FOO 123
++ {arg_help_lines}
+ """
+ )[1:]
+ )