commit:     1d7e8a4fc219d6af3d91fb03fd11c9868171a84b
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 10 08:46:57 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Mar 10 10:03:25 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1d7e8a4f

dev-python/pip: Backport a fix for scripttest-2 failures

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

 dev-python/pip/files/pip-25.0.1-scripttest-2.patch | 43 ++++++++++++++++++++++
 dev-python/pip/pip-25.0.1-r1.ebuild                |  2 +
 2 files changed, 45 insertions(+)

diff --git a/dev-python/pip/files/pip-25.0.1-scripttest-2.patch 
b/dev-python/pip/files/pip-25.0.1-scripttest-2.patch
new file mode 100644
index 000000000000..950f70c192dd
--- /dev/null
+++ b/dev-python/pip/files/pip-25.0.1-scripttest-2.patch
@@ -0,0 +1,43 @@
+From 3c77c106330ca77883e9e3c7a150032bb5db73fd Mon Sep 17 00:00:00 2001
+From: Richard Si <[email protected]>
+Date: Sat, 8 Mar 2025 10:44:32 -0500
+Subject: [PATCH] tests: Use script.scratch_path over script.temp_path
+
+script.temp_path is the system temporary directory. scripttest will
+check that there aren't any dangling files left in there, thus it's
+inappropriate to write long-lived packages there.
+
+These tests are currently passing as scripttest's temporary file
+detection logic is broken. However, a newer version of scripttest will
+fail.
+---
+ tests/functional/test_cli.py    | 2 +-
+ tests/functional/test_pep517.py | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tests/functional/test_cli.py b/tests/functional/test_cli.py
+index 65946a1f46a..366d0129b2d 100644
+--- a/tests/functional/test_cli.py
++++ b/tests/functional/test_cli.py
+@@ -24,7 +24,7 @@ def test_entrypoints_work(entrypoint: str, script: 
PipTestEnvironment) -> None:
+     if script.zipapp:
+         pytest.skip("Zipapp does not include entrypoints")
+ 
+-    fake_pkg = script.temp_path / "fake_pkg"
++    fake_pkg = script.scratch_path / "fake_pkg"
+     fake_pkg.mkdir()
+     fake_pkg.joinpath("setup.py").write_text(
+         dedent(
+diff --git a/tests/functional/test_pep517.py b/tests/functional/test_pep517.py
+index fd9380d0eb6..34ddd6633ce 100644
+--- a/tests/functional/test_pep517.py
++++ b/tests/functional/test_pep517.py
+@@ -252,7 +252,7 @@ def 
test_pep517_backend_requirements_satisfied_by_prerelease(
+     script.pip("install", "test_backend", "--no-index", "-f", data.backends)
+ 
+     project_dir = make_project(
+-        script.temp_path,
++        script.scratch_path,
+         requires=["test_backend", "myreq"],
+         backend="test_backend",
+     )

diff --git a/dev-python/pip/pip-25.0.1-r1.ebuild 
b/dev-python/pip/pip-25.0.1-r1.ebuild
index c29b754e9b07..b0a01d6a0fb0 100644
--- a/dev-python/pip/pip-25.0.1-r1.ebuild
+++ b/dev-python/pip/pip-25.0.1-r1.ebuild
@@ -76,6 +76,8 @@ python_prepare_all() {
                "${FILESDIR}/pip-23.1-no-coverage.patch"
                # prepare to unbundle dependencies
                "${FILESDIR}/pip-25.0.1-unbundle.patch"
+               # https://github.com/pypa/pip/pull/13272
+               "${FILESDIR}/${P}-scripttest-2.patch"
        )
 
        distutils-r1_python_prepare_all

Reply via email to