summaryrefslogtreecommitdiff
path: root/dev-python/argh
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/argh')
-rw-r--r--dev-python/argh/Manifest1
-rw-r--r--dev-python/argh/argh-0.31.3.ebuild34
-rw-r--r--dev-python/argh/files/argh-0.31.3-py314.patch54
-rw-r--r--dev-python/argh/metadata.xml10
4 files changed, 99 insertions, 0 deletions
diff --git a/dev-python/argh/Manifest b/dev-python/argh/Manifest
new file mode 100644
index 000000000000..243309230cdc
--- /dev/null
+++ b/dev-python/argh/Manifest
@@ -0,0 +1 @@
+DIST argh-0.31.3.tar.gz 57570 BLAKE2B cb88813701f42657a8e89cab46be367c751ae59cc05d5eba9cebd77d375a73413b33e76d48bf84b42559fcf25f3d4b87473b124346fd4f3ba5433e60204b06a1 SHA512 c3335f975e612332ee9e3479f4517f356bacaad77f0df1e8660d5306257a8e32b139cdaa49c2c4bfa234f32e39e324182de997313c43ea4f45f2e11de7e2a24c
diff --git a/dev-python/argh/argh-0.31.3.ebuild b/dev-python/argh/argh-0.31.3.ebuild
new file mode 100644
index 000000000000..f44fc0d95036
--- /dev/null
+++ b/dev-python/argh/argh-0.31.3.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=flit
+PYTHON_COMPAT=( python3_{13..14} )
+
+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 ~m68k ppc ppc64 ~riscv ~s390 ~sparc x86"
+
+BDEPEND="
+ test? (
+ dev-python/iocapture[${PYTHON_USEDEP}]
+ )
+"
+
+EPYTEST_PLUGINS=()
+distutils_enable_tests pytest
+
+PATCHES=(
+ # https://github.com/neithere/argh/commit/699568ad674c5ea26d361202c386a8a8a82ec8ad
+ "${FILESDIR}/${P}-py314.patch"
+)
diff --git a/dev-python/argh/files/argh-0.31.3-py314.patch b/dev-python/argh/files/argh-0.31.3-py314.patch
new file mode 100644
index 000000000000..ef1ac87ebbc7
--- /dev/null
+++ b/dev-python/argh/files/argh-0.31.3-py314.patch
@@ -0,0 +1,54 @@
+From 699568ad674c5ea26d361202c386a8a8a82ec8ad Mon Sep 17 00:00:00 2001
+From: Andy Mikhaylenko <neithere@gmail.com>
+Date: Sun, 1 Jun 2025 21:28:53 +0200
+Subject: [PATCH] fix(test): tests were broken under Python 3.14.0b2 (fixes
+ #239)
+
+(stripped down to bare essentials)
+
+--- a/tests/test_integration.py
++++ b/tests/test_integration.py
+@@ -796,11 +796,17 @@ def func():
+ parser = DebugArghParser()
+ parser.set_default_command(func)
+
+- assert unindent(func.__doc__) in parser.format_help()
++ docstring = func.__doc__
++ assert docstring
++ assert unindent(docstring) in parser.format_help()
+
+
+ def test_prog(capsys: pytest.CaptureFixture[str]):
+- "Program name propagates from sys.argv[0]"
++ """
++ Program name propagates to the usage string.
++ It's not just sys.argv[0], the logic is a bit more complicated in argparse,
++ so we just reuse whatever it has produced.
++ """
+
+ def cmd(*, foo=1):
+ return foo
+@@ -808,10 +814,12 @@ def cmd(*, foo=1):
+ parser = DebugArghParser()
+ parser.add_commands([cmd])
+
+- usage = get_usage_string()
++ usage = f"usage: {parser.prog} [-h]"
+
+- assert run(parser, "-h", exit=True) == 0
++ exit_code = run(parser, "-h", exit=True)
+ captured = capsys.readouterr()
++
++ assert exit_code == 0
+ assert captured.out.startswith(usage)
+
+
+@@ -822,8 +830,6 @@ def cmd(*, foo=1):
+ parser = DebugArghParser()
+ parser.set_default_command(cmd)
+
+- get_usage_string("[-f FOO]")
+-
+ assert run(parser, "--foo 1") == R(out="1\n", err="")
+ assert run(parser, "--bar 1", exit=True) == "unrecognized arguments: --bar 1"
+ assert run(parser, "--bar 1", exit=False, kwargs={"skip_unknown_args": True}) == R(
diff --git a/dev-python/argh/metadata.xml b/dev-python/argh/metadata.xml
new file mode 100644
index 000000000000..5e95859f915a
--- /dev/null
+++ b/dev-python/argh/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>python@gentoo.org</email>
+ <name>Python</name>
+ </maintainer>
+ <stabilize-allarches />
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>