fix: disable use of pip install --python for debundled pip#861
fix: disable use of pip install --python for debundled pip#861
pip install --python for debundled pip#861Conversation
|
Looks like distutils import hack from |
|
I don't think this will fix it, but I'd not do |
|
Yes, it is. Unfortunately, I don't see how to fix it — in the end, the |
|
I think the remaining failures are flaky tests. |
|
What's the warning, out of curiosity? |
Basically this: >>> import distutils
>>> import pip
/usr/lib/python3.10/site-packages/_distutils_hack/__init__.py:30: UserWarning: Setuptools is replacing distutils. Support for replacing an already imported distutils is deprecated. In the future, this condition will fail. Register concerns at https://github.com/pypa/setuptools/issues/new?template=distutils-deprecation.yml
warnings.warn( |
Pip is full of hacks - the build-isolation support is a mess, for example. IMO using Regardless, though, this seems fine. I'll try to fix the |
In the debundled pip version distributed on Gentoo systems, `pip install --python` is nonfunctional since it expects all of pip's dependencies to be present in the (empty) virtual environment. Detect this case by the removal of `pip._vendor` package, and use the "no valid outer pip" codepath. Bug: https://bugs.gentoo.org/934922
|
Thanks! |
pip install --python on Gentoo debundled pippip install --python for debundled pip
Fix the exception raised if `pip` is not installed at all:
```
[...]
File "/usr/lib/python3.14/site-packages/build/env.py", line 168, in _has_valid_outer_pip
if importlib.util.find_spec('pip._vendor') is None:
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
File "<frozen importlib.util>", line 90, in find_spec
ModuleNotFoundError: No module named 'pip'
```
This is a regression from pypa#861 where I did not predict that
`find_spec()` will actually raise when the parent package
is not available. To fix it, just reorder the conditions to make sure
that `pip` is installed first.
Fix the exception raised if `pip` is not installed at all:
```
[...]
File "/usr/lib/python3.14/site-packages/build/env.py", line 168, in _has_valid_outer_pip
if importlib.util.find_spec('pip._vendor') is None:
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
File "<frozen importlib.util>", line 90, in find_spec
ModuleNotFoundError: No module named 'pip'
```
This is a regression from pypa#861 where I did not predict that
`find_spec()` will actually raise when the parent package
is not available. To fix it, just reorder the conditions to make sure
that `pip` is installed first.
* fix: Fix `ModuleNotFoundError` when `pip` is not installed
Fix the exception raised if `pip` is not installed at all:
```
[...]
File "/usr/lib/python3.14/site-packages/build/env.py", line 168, in _has_valid_outer_pip
if importlib.util.find_spec('pip._vendor') is None:
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
File "<frozen importlib.util>", line 90, in find_spec
ModuleNotFoundError: No module named 'pip'
```
This is a regression from #861 where I did not predict that
`find_spec()` will actually raise when the parent package
is not available. To fix it, just reorder the conditions to make sure
that `pip` is installed first.
* Update src/build/env.py
---------
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
In the debundled pip version distributed on Gentoo systems,
pip install --pythonis nonfunctional since it expects all of pip's dependencies to be present in the (empty) virtual environment. Detect this case by the removal ofpip._vendorpackage, and use the "no valid outer pip" codepath.Bug: https://bugs.gentoo.org/934922