mirror of https://github.com/pypa/pip
Handle standalone pip creation from pip wheel
This change ensures that when pip is executed from a wheel/zip, standalone pip creation for build environment reuses the source. Resolves: #9953 Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
This commit is contained in:
parent
e6414d6db6
commit
8ef383bb23
|
@ -0,0 +1 @@
|
|||
Fix detection of existing standalone pip instance for PEP 517 builds.
|
|
@ -50,9 +50,9 @@ def _create_standalone_pip() -> Iterator[str]:
|
|||
"""
|
||||
source = pathlib.Path(pip_location).resolve().parent
|
||||
|
||||
# Return the current instance if it is already a zip file. This can happen
|
||||
# if a PEP 517 requirement is an sdist itself.
|
||||
if not source.is_dir() and source.parent.name == "__env_pip__.zip":
|
||||
# Return the current instance if `source` is not a directory. We can't build
|
||||
# a zip from this, and it likely means the instance is already standalone.
|
||||
if not source.is_dir():
|
||||
yield str(source)
|
||||
return
|
||||
|
||||
|
|
Loading…
Reference in New Issue