Skip to content

Commit

Permalink
Reduce vertical span of prepare_linked_requirement
Browse files Browse the repository at this point in the history
  • Loading branch information
McSinyx committed Jun 10, 2020
1 parent 63ae73e commit 90615fe
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/pip/_internal/operations/prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,6 @@ def _get_linked_req_hashes(self, req):
def prepare_linked_requirement(self, req, parallel_builds=False):
# type: (InstallRequirement, bool) -> AbstractDistribution
"""Prepare a requirement to be obtained from req.link."""
# TODO: Breakup into smaller functions
assert req.link
link = req.link
self._log_preparing_link(req, link)
Expand All @@ -468,21 +467,18 @@ def prepare_linked_requirement(self, req, parallel_builds=False):
req.local_file_path = local_file.path

abstract_dist = _get_prepared_distribution(
req, self.req_tracker, self.finder, self.build_isolation,
)
req, self.req_tracker, self.finder, self.build_isolation)

if download_dir:
if link.is_existing_dir():
logger.info('Link is a directory, ignoring download_dir')
elif local_file:
download_location = os.path.join(
download_dir, link.filename
)
download_dir, link.filename)
if not os.path.exists(download_location):
shutil.copy(local_file.path, download_location)
logger.info(
'Saved %s', display_path(download_location)
)
download_path = display_path(download_location)
logger.info('Saved {}'.format(download_path))

if self._download_should_save:
# Make a .zip of the source_dir we already created.
Expand Down

0 comments on commit 90615fe

Please sign in to comment.