dev-python/pip: Sync with Gentoo

It's from Gentoo commit 3af1a248a5cd753ea6ae9cca95a870f70fbf6cfa.
This commit is contained in:
Flatcar Buildbot 2025-03-17 07:07:09 +00:00 committed by Krzesimir Nowak
parent 39b09aefba
commit 9850a1011c
2 changed files with 50 additions and 7 deletions

View File

@ -0,0 +1,43 @@
From 3c77c106330ca77883e9e3c7a150032bb5db73fd Mon Sep 17 00:00:00 2001
From: Richard Si <sichard26@gmail.com>
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",
)

View File

@ -6,11 +6,11 @@ EAPI=8
# please bump dev-python/ensurepip-pip along with this package!
DISTUTILS_USE_PEP517=setuptools
PYTHON_TESTED=( pypy3 python3_{10..13} )
PYTHON_COMPAT=( "${PYTHON_TESTED[@]}" pypy3_11 )
PYTHON_TESTED=( pypy3 pypy3_11 python3_{10..13} )
PYTHON_COMPAT=( "${PYTHON_TESTED[@]}" )
PYTHON_REQ_USE="ssl(+),threads(+)"
inherit bash-completion-r1 distutils-r1
inherit distutils-r1 shell-completion
DESCRIPTION="The PyPA recommended tool for installing Python packages"
HOMEPAGE="
@ -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
@ -137,7 +139,7 @@ python_test() {
)
case ${EPYTHON} in
pypy3)
pypy3*)
EPYTEST_DESELECT+=(
# unexpected tempfiles?
tests/functional/test_install_config.py::test_do_not_prompt_for_authentication
@ -169,7 +171,5 @@ python_install_all() {
distutils-r1_python_install_all
newbashcomp completion.bash pip
insinto /usr/share/zsh/site-functions
newins completion.zsh _pip
newzshcomp completion.zsh _pip
}