Merge updates from master

This commit is contained in:
Repository mirror & CI
2026-04-15 07:45:55 +00:00
6 changed files with 90 additions and 6 deletions

View File

@@ -1,10 +1,10 @@
# Copyright 1999-2025 Gentoo Authors
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{11..13} )
PYTHON_COMPAT=( python3_{11..14} )
inherit distutils-r1
@@ -42,4 +42,6 @@ EPYTEST_DESELECT=(
PATCHES=(
# https://github.com/kyuupichan/aiorpcX/commit/b8ce32889c45c98b44c4e247ec0b0ae206e9ee91
"${FILESDIR}/${P}-pytest-asyncio-1.patch"
# https://github.com/kyuupichan/aiorpcX/commit/25043621700672ee375d20b78804118acac43b1b
"${FILESDIR}/${P}-py314.patch"
)

View File

@@ -0,0 +1,22 @@
From 25043621700672ee375d20b78804118acac43b1b Mon Sep 17 00:00:00 2001
From: Neil Booth <kyuupichan@pm.me>
Date: Thu, 19 Feb 2026 13:29:30 +0000
Subject: [PATCH] Make test_misc() async (danigm)
---
tests/test_jsonrpc.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/test_jsonrpc.py b/tests/test_jsonrpc.py
index 81414a7..8cda788 100755
--- a/tests/test_jsonrpc.py
+++ b/tests/test_jsonrpc.py
@@ -1064,7 +1064,7 @@ async def send_batch(batch):
await group.spawn(send_batch(batch))
-def test_misc(protocol):
+async def test_misc(protocol):
'''Misc tests to get full coverage.'''
connection = JSONRPCConnection(protocol)

View File

@@ -1,10 +1,10 @@
# Copyright 1999-2025 Gentoo Authors
# 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_{10..13} pypy3 pypy3_11 )
PYTHON_COMPAT=( python3_{11..14} pypy3_11 )
inherit distutils-r1 pypi
@@ -25,4 +25,10 @@ BDEPEND="
)
"
EPYTEST_PLUGINS=()
distutils_enable_tests pytest
PATCHES=(
# https://github.com/neithere/argh/commit/699568ad674c5ea26d361202c386a8a8a82ec8ad
"${FILESDIR}/${P}-py314.patch"
)

View File

@@ -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(

View File

@@ -4,7 +4,7 @@
EAPI=8
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{11..13} )
PYTHON_COMPAT=( python3_{11..14} )
inherit distutils-r1 pypi

View File

@@ -4,7 +4,7 @@
EAPI=8
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{11..13} )
PYTHON_COMPAT=( python3_{11..14} )
PYTHON_REQ_USE="ncurses?"
inherit distutils-r1 eapi9-ver verify-sig xdg-utils