* [gentoo-commits] repo/gentoo:master commit in: dev-python/argh/files/, dev-python/argh/
@ 2021-12-01 17:47 Arthur Zamarin
0 siblings, 0 replies; 2+ messages in thread
From: Arthur Zamarin @ 2021-12-01 17:47 UTC (permalink / raw
To: gentoo-commits
commit: 6f194f12a2e30aad7da347848f7b0187e188f983
Author: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 1 17:44:23 2021 +0000
Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Wed Dec 1 17:47:04 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6f194f12
dev-python/argh: partial tests fix
Fix two of 4 tests failures. Other two happen only on python-3.9.8
and not any later version, so will auto fix itself with time. See
bug for more info.
Bug: https://bugs.gentoo.org/823832
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>
dev-python/argh/argh-0.26.2-r2.ebuild | 6 ++++-
.../argh/files/argh-0.26.2-fix-py3.9-msgs.patch | 31 ++++++++++++++++++++++
2 files changed, 36 insertions(+), 1 deletion(-)
diff --git a/dev-python/argh/argh-0.26.2-r2.ebuild b/dev-python/argh/argh-0.26.2-r2.ebuild
index 65fa34c728af..a596f642c0c6 100644
--- a/dev-python/argh/argh-0.26.2-r2.ebuild
+++ b/dev-python/argh/argh-0.26.2-r2.ebuild
@@ -3,7 +3,7 @@
EAPI=7
-PYTHON_COMPAT=( python3_{7..10} pypy3 )
+PYTHON_COMPAT=( python3_{8..10} pypy3 )
inherit distutils-r1
@@ -21,4 +21,8 @@ BDEPEND="
dev-python/mock[${PYTHON_USEDEP}]
)"
+PATCHES=(
+ "${FILESDIR}/${P}-fix-py3.9-msgs.patch"
+)
+
distutils_enable_tests pytest
diff --git a/dev-python/argh/files/argh-0.26.2-fix-py3.9-msgs.patch b/dev-python/argh/files/argh-0.26.2-fix-py3.9-msgs.patch
new file mode 100644
index 000000000000..5835c5acbb8e
--- /dev/null
+++ b/dev-python/argh/files/argh-0.26.2-fix-py3.9-msgs.patch
@@ -0,0 +1,31 @@
+diff --git a/test/test_integration.py b/test/test_integration.py
+index 8899d8e..589f6d6 100644
+--- a/test/test_integration.py
++++ b/test/test_integration.py
+@@ -377,7 +377,7 @@ def test_invalid_choice():
+ p = DebugArghParser()
+ p.add_commands([cmd])
+
+- assert run(p, 'bar', exit=True).startswith('invalid choice')
++ assert 'invalid choice' in run(p, 'bar', exit=True)
+
+ if sys.version_info < (3,3):
+ # Python before 3.3 exits with a less informative error
+@@ -391,7 +391,7 @@ def test_invalid_choice():
+ p = DebugArghParser()
+ p.add_commands([cmd], namespace='nest')
+
+- assert run(p, 'nest bar', exit=True).startswith('invalid choice')
++ assert 'invalid choice' in run(p, 'nest bar', exit=True)
+
+ if sys.version_info < (3,3):
+ # Python before 3.3 exits with a less informative error
+@@ -511,7 +511,7 @@ def test_explicit_cmd_name():
+
+ p = DebugArghParser()
+ p.add_commands([orig_name])
+- assert run(p, 'orig-name', exit=True).startswith('invalid choice')
++ assert 'invalid choice' in run(p, 'orig-name', exit=True)
+ assert run(p, 'new-name').out == 'ok\n'
+
+
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/argh/files/, dev-python/argh/
@ 2024-08-03 6:37 Michał Górny
0 siblings, 0 replies; 2+ messages in thread
From: Michał Górny @ 2024-08-03 6:37 UTC (permalink / raw
To: gentoo-commits
commit: b16730051e07dcfb464cae57e2b71c44a6077e22
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 3 06:27:24 2024 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Aug 3 06:27:24 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b1673005
dev-python/argh: Remove old
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
dev-python/argh/Manifest | 1 -
dev-python/argh/argh-0.31.2.ebuild | 33 ------
dev-python/argh/files/argh-0.31.2-py313.patch | 164 --------------------------
3 files changed, 198 deletions(-)
diff --git a/dev-python/argh/Manifest b/dev-python/argh/Manifest
index 611118f34f4b..243309230cdc 100644
--- a/dev-python/argh/Manifest
+++ b/dev-python/argh/Manifest
@@ -1,2 +1 @@
-DIST argh-0.31.2.tar.gz 57200 BLAKE2B e5ba440d08d8f5655d237d61ab65fef02296d28d0562945e56dfa6598deafa6cc288d88e625c4acabfa2eeda359f970679db1e7424d77e0278b65fbe15c8b499 SHA512 2e0d926cae88d6830706f631aa2220654777dcc1a4263af889064d4c805616fce368c90e871a393490b9590f82759f56b2434afeba468e7720f99d85c8b75dd1
DIST argh-0.31.3.tar.gz 57570 BLAKE2B cb88813701f42657a8e89cab46be367c751ae59cc05d5eba9cebd77d375a73413b33e76d48bf84b42559fcf25f3d4b87473b124346fd4f3ba5433e60204b06a1 SHA512 c3335f975e612332ee9e3479f4517f356bacaad77f0df1e8660d5306257a8e32b139cdaa49c2c4bfa234f32e39e324182de997313c43ea4f45f2e11de7e2a24c
diff --git a/dev-python/argh/argh-0.31.2.ebuild b/dev-python/argh/argh-0.31.2.ebuild
deleted file mode 100644
index 0c53e95bef20..000000000000
--- a/dev-python/argh/argh-0.31.2.ebuild
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright 1999-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-DISTUTILS_USE_PEP517=flit
-PYTHON_COMPAT=( python3_{10..13} pypy3 )
-
-inherit distutils-r1 pypi
-
-DESCRIPTION="A simple argparse wrapper"
-HOMEPAGE="
- https://pythonhosted.org/argh/
- https://github.com/neithere/argh/
- https://pypi.org/project/argh/
-"
-
-LICENSE="LGPL-3"
-SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ppc ppc64 ~riscv ~s390 sparc x86"
-
-BDEPEND="
- test? (
- dev-python/iocapture[${PYTHON_USEDEP}]
- )
-"
-
-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
deleted file mode 100644
index 4049fedc0d0d..000000000000
--- a/dev-python/argh/files/argh-0.31.2-py313.patch
+++ /dev/null
@@ -1,164 +0,0 @@
-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:]
- )
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-08-03 6:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-03 6:37 [gentoo-commits] repo/gentoo:master commit in: dev-python/argh/files/, dev-python/argh/ Michał Górny
-- strict thread matches above, loose matches on Subject: below --
2021-12-01 17:47 Arthur Zamarin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox