File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -45,12 +45,19 @@ def __init__(self, path):
45
45
def _create_standalone_pip () -> Iterator [str ]:
46
46
"""Create a "standalone pip" zip file.
47
47
48
- The zip file contains a (modified) copy of the pip currently running.
48
+ The zip file's content is identical to the currently- running pip .
49
49
It will be used to install requirements into the build environment.
50
50
"""
51
51
source = pathlib .Path (pip_location ).resolve ().parent
52
+
53
+ # Return the current instance if it is already a zip file. This can happen
54
+ # if a PEP 517 requirement is an sdist itself.
55
+ if not source .is_dir () and source .parent .name == "__env_pip__.zip" :
56
+ yield str (source )
57
+ return
58
+
52
59
with TempDirectory (kind = "standalone-pip" ) as tmp_dir :
53
- pip_zip = os .path .join (tmp_dir .path , "pip .zip" )
60
+ pip_zip = os .path .join (tmp_dir .path , "__env_pip__ .zip" )
54
61
with zipfile .ZipFile (pip_zip , "w" ) as zf :
55
62
for child in source .rglob ("*" ):
56
63
zf .write (child , child .relative_to (source .parent ).as_posix ())
You can’t perform that action at this time.
0 commit comments