Skip to content

Commit

Permalink
The preparer always clones VCS requirements
Browse files Browse the repository at this point in the history
Previously, in download mode, it did a vcs export,
which did not include vcs information, leading to
issues when the build backend required it.
  • Loading branch information
sbidoul committed Dec 23, 2020
1 parent c735b7d commit f88343e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/pip/_internal/operations/prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ def prepare_editable_requirement(
'hash.'.format(req)
)
req.ensure_has_source_dir(self.src_dir)
req.update_editable(self.download_dir is None)
req.update_editable()

dist = _get_prepared_distribution(
req, self.req_tracker, self.finder, self.build_isolation,
Expand Down
9 changes: 3 additions & 6 deletions src/pip/_internal/req/req_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,8 +617,8 @@ def ensure_has_source_dir(
)

# For editable installations
def update_editable(self, obtain=True):
# type: (bool) -> None
def update_editable(self):
# type: () -> None
if not self.link:
logger.debug(
"Cannot update repository at %s; repository location is "
Expand Down Expand Up @@ -651,10 +651,7 @@ def update_editable(self, obtain=True):
)
deprecated(reason, replacement, gone_in="21.0", issue=7554)
hidden_url = hide_url(self.link.url)
if obtain:
vcs_backend.obtain(self.source_dir, url=hidden_url)
else:
vcs_backend.export(self.source_dir, url=hidden_url)
vcs_backend.obtain(self.source_dir, url=hidden_url)
else:
assert 0, (
'Unexpected version control type (in {}): {}'.format(
Expand Down

0 comments on commit f88343e

Please sign in to comment.