diff options
Diffstat (limited to 'dev-python')
| -rw-r--r-- | dev-python/build/build-1.2.2_p1-r1.ebuild (renamed from dev-python/build/build-1.2.2_p1.ebuild) | 5 | ||||
| -rw-r--r-- | dev-python/build/files/build-1.2.2_p1-gentoo-pip.patch | 28 |
2 files changed, 33 insertions, 0 deletions
diff --git a/dev-python/build/build-1.2.2_p1.ebuild b/dev-python/build/build-1.2.2_p1-r1.ebuild index ce998bf4e24a..1abc9dd82b84 100644 --- a/dev-python/build/build-1.2.2_p1.ebuild +++ b/dev-python/build/build-1.2.2_p1-r1.ebuild @@ -52,6 +52,11 @@ BDEPEND=" distutils_enable_tests pytest +PATCHES=( + # https://github.com/pypa/build/pull/861 + "${FILESDIR}/${P}-gentoo-pip.patch" +) + python_test() { if ! has "${EPYTHON/./_}" "${PYTHON_TESTED[@]}"; then einfo "Skipping tests on ${EPYTHON}" diff --git a/dev-python/build/files/build-1.2.2_p1-gentoo-pip.patch b/dev-python/build/files/build-1.2.2_p1-gentoo-pip.patch new file mode 100644 index 000000000000..4335500e73a8 --- /dev/null +++ b/dev-python/build/files/build-1.2.2_p1-gentoo-pip.patch @@ -0,0 +1,28 @@ +diff --git a/src/build/env.py b/src/build/env.py +index b8c7b5f6..f10cf4bf 100644 +--- a/src/build/env.py ++++ b/src/build/env.py +@@ -11,6 +11,7 @@ + import sysconfig + import tempfile + import typing ++import warnings + + from collections.abc import Collection, Mapping + +@@ -158,6 +159,15 @@ def _has_valid_outer_pip(self) -> bool | None: + This checks for a valid global pip. Returns None if pip is missing, False + if pip is too old, and True if it can be used. + """ ++ # `pip install --python` is nonfunctional on Gentoo debundled pip. ++ # Detect that by checking if pip._vendor` module exists. However, ++ # searching for pip could yield warnings from _distutils_hack, ++ # so silence them. ++ with warnings.catch_warnings(): ++ warnings.simplefilter('ignore') ++ if importlib.util.find_spec('pip._vendor') is None: ++ return False # pragma: no cover ++ + # Version to have added the `--python` option. + return _has_dependency('pip', '22.3') + |
