mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
Do not download editables while preparing requirements
Downloading is done at the end of the download command just like any other requirement. This is necessary to avoid archiving editable requirements to a zip file when running pip wheel.
This commit is contained in:
parent
11d07016d9
commit
a24d198c15
4 changed files with 6 additions and 5 deletions
2
news/9122.bugfix.rst
Normal file
2
news/9122.bugfix.rst
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
Fix a regression that made ``pip wheel`` generate zip files of editable
|
||||||
|
requirements in the wheel directory.
|
|
@ -132,7 +132,7 @@ class DownloadCommand(RequirementCommand):
|
||||||
|
|
||||||
downloaded = [] # type: List[str]
|
downloaded = [] # type: List[str]
|
||||||
for req in requirement_set.requirements.values():
|
for req in requirement_set.requirements.values():
|
||||||
if not req.editable and req.satisfied_by is None:
|
if req.satisfied_by is None:
|
||||||
assert req.name is not None
|
assert req.name is not None
|
||||||
preparer.save_linked_requirement(req)
|
preparer.save_linked_requirement(req)
|
||||||
downloaded.append(req.name)
|
downloaded.append(req.name)
|
||||||
|
|
|
@ -530,7 +530,7 @@ class RequirementPreparer(object):
|
||||||
assert self.download_dir is not None
|
assert self.download_dir is not None
|
||||||
assert req.link is not None
|
assert req.link is not None
|
||||||
link = req.link
|
link = req.link
|
||||||
if link.is_vcs:
|
if link.is_vcs or (link.is_existing_dir() and req.editable):
|
||||||
# Make a .zip of the source_dir we already created.
|
# Make a .zip of the source_dir we already created.
|
||||||
req.archive(self.download_dir)
|
req.archive(self.download_dir)
|
||||||
return
|
return
|
||||||
|
@ -576,7 +576,6 @@ class RequirementPreparer(object):
|
||||||
req, self.req_tracker, self.finder, self.build_isolation,
|
req, self.req_tracker, self.finder, self.build_isolation,
|
||||||
)
|
)
|
||||||
|
|
||||||
req.archive(self.download_dir)
|
|
||||||
req.check_if_exists(self.use_user_site)
|
req.check_if_exists(self.use_user_site)
|
||||||
|
|
||||||
return dist
|
return dist
|
||||||
|
|
|
@ -855,9 +855,9 @@ def test_download_editable(script, data, tmpdir):
|
||||||
"""
|
"""
|
||||||
Test 'pip download' of editables in requirement file.
|
Test 'pip download' of editables in requirement file.
|
||||||
"""
|
"""
|
||||||
editable_path = os.path.join(data.src, 'simplewheel-1.0')
|
editable_path = str(data.src / 'simplewheel-1.0').replace(os.path.sep, "/")
|
||||||
requirements_path = tmpdir / "requirements.txt"
|
requirements_path = tmpdir / "requirements.txt"
|
||||||
requirements_path.write_text("-e " + str(editable_path.resolve()) + "\n")
|
requirements_path.write_text("-e " + editable_path + "\n")
|
||||||
download_dir = tmpdir / "download_dir"
|
download_dir = tmpdir / "download_dir"
|
||||||
script.pip(
|
script.pip(
|
||||||
'download', '--no-deps', '-r', str(requirements_path), '-d', str(download_dir)
|
'download', '--no-deps', '-r', str(requirements_path), '-d', str(download_dir)
|
||||||
|
|
Loading…
Reference in a new issue