From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1688288-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id C2F7A158042
	for <garchives@archives.gentoo.org>; Sat,  9 Nov 2024 16:46:42 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 1D7FEE086A;
	Sat,  9 Nov 2024 16:46:42 +0000 (UTC)
Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 02106E086A
	for <gentoo-commits@lists.gentoo.org>; Sat,  9 Nov 2024 16:46:42 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 1CBEE335D72
	for <gentoo-commits@lists.gentoo.org>; Sat,  9 Nov 2024 16:46:41 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 77991AED
	for <gentoo-commits@lists.gentoo.org>; Sat,  9 Nov 2024 16:46:39 +0000 (UTC)
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" <mgorny@gentoo.org>
Message-ID: <1731170795.c402b30fe5e302093966fe487aa286765d314fac.mgorny@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pip/, dev-python/pip/files/
X-VCS-Repository: repo/gentoo
X-VCS-Files: dev-python/pip/files/pip-24.3.1-rich-13.8.patch dev-python/pip/pip-24.3.1-r1.ebuild dev-python/pip/pip-24.3.1.ebuild
X-VCS-Directories: dev-python/pip/files/ dev-python/pip/
X-VCS-Committer: mgorny
X-VCS-Committer-Name: Michał Górny
X-VCS-Revision: c402b30fe5e302093966fe487aa286765d314fac
X-VCS-Branch: master
Date: Sat,  9 Nov 2024 16:46:39 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 802a1122-d280-4ade-9728-68e0e2334265
X-Archives-Hash: 1dd45f64b7661a64e77c3ceb3615c124

commit:     c402b30fe5e302093966fe487aa286765d314fac
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Nov  9 16:11:59 2024 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Nov  9 16:46:35 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c402b30f

dev-python/pip: Patch for newer dev-python/rich support

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/pip/files/pip-24.3.1-rich-13.8.patch    | 47 ++++++++++++++++++++++
 .../{pip-24.3.1.ebuild => pip-24.3.1-r1.ebuild}    |  3 +-
 2 files changed, 49 insertions(+), 1 deletion(-)

diff --git a/dev-python/pip/files/pip-24.3.1-rich-13.8.patch b/dev-python/pip/files/pip-24.3.1-rich-13.8.patch
new file mode 100644
index 000000000000..d17ccf5b2fe3
--- /dev/null
+++ b/dev-python/pip/files/pip-24.3.1-rich-13.8.patch
@@ -0,0 +1,47 @@
+From 8cfd050f615a4bad699ec55d4cb19b1f1dc4137e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Sat, 9 Nov 2024 16:41:40 +0100
+Subject: [PATCH] Override rich.console pipe handler for rich 13.8.0+
+
+Explicitly override `rich.console.Console.on_broken_pipe()` to reraise
+the original exception, to bring the behavior of rich 13.8.0+ in line
+with older versions.  The new versions instead close output fds and exit
+with error instead, which prevents pip's pipe handler from firing.
+This is the minimal change needed to make pip's test suite pass after
+upgrading vendored rich.
+
+Bug #13006
+Bug #13072
+---
+ src/pip/_internal/utils/logging.py | 9 ++++++++-
+ 2 files changed, 8 insertions(+), 1 deletion(-)
+ create mode 100644 news/13072.trivial.rst
+
+diff --git a/src/pip/_internal/utils/logging.py b/src/pip/_internal/utils/logging.py
+index 41f6eb51a..be17add5d 100644
+--- a/src/pip/_internal/utils/logging.py
++++ b/src/pip/_internal/utils/logging.py
+@@ -137,12 +137,19 @@ class IndentedRenderable:
+             yield Segment("\n")
+ 
+ 
++class PipConsole(Console):
++    def on_broken_pipe(self) -> None:
++        # Reraise the original exception, rich 13.8.0+ exits by default
++        # instead, preventing our handler from firing.
++        raise BrokenPipeError() from None
++
++
+ class RichPipStreamHandler(RichHandler):
+     KEYWORDS: ClassVar[Optional[List[str]]] = []
+ 
+     def __init__(self, stream: Optional[TextIO], no_color: bool) -> None:
+         super().__init__(
+-            console=Console(file=stream, no_color=no_color, soft_wrap=True),
++            console=PipConsole(file=stream, no_color=no_color, soft_wrap=True),
+             show_time=False,
+             show_level=False,
+             show_path=False,
+-- 
+2.47.0
+

diff --git a/dev-python/pip/pip-24.3.1.ebuild b/dev-python/pip/pip-24.3.1-r1.ebuild
similarity index 98%
rename from dev-python/pip/pip-24.3.1.ebuild
rename to dev-python/pip/pip-24.3.1-r1.ebuild
index 472164bfd648..fef0d38e70a2 100644
--- a/dev-python/pip/pip-24.3.1.ebuild
+++ b/dev-python/pip/pip-24.3.1-r1.ebuild
@@ -58,7 +58,6 @@ BDEPEND="
 			dev-python/pretend[${PYTHON_USEDEP}]
 			dev-python/pytest-rerunfailures[${PYTHON_USEDEP}]
 			dev-python/pytest-xdist[${PYTHON_USEDEP}]
-			<dev-python/rich-13.8[${PYTHON_USEDEP}]
 			dev-python/scripttest[${PYTHON_USEDEP}]
 			dev-python/tomli-w[${PYTHON_USEDEP}]
 			dev-python/virtualenv[${PYTHON_USEDEP}]
@@ -79,6 +78,8 @@ python_prepare_all() {
 		"${FILESDIR}/pip-23.1-no-coverage.patch"
 		# prepare to unbundle dependencies
 		"${FILESDIR}/pip-24.1-unbundle.patch"
+		# https://github.com/pypa/pip/pull/13073
+		"${FILESDIR}/pip-24.3.1-rich-13.8.patch"
 	)
 
 	distutils-r1_python_prepare_all