mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
Remove download_dir exist check
Both pip download and wheel call endure_dir on the directory.
This commit is contained in:
parent
dcc12f3786
commit
78b294e746
|
@ -87,7 +87,6 @@ class DownloadCommand(RequirementCommand):
|
||||||
cmdoptions.check_dist_restriction(options)
|
cmdoptions.check_dist_restriction(options)
|
||||||
|
|
||||||
options.download_dir = normalize_path(options.download_dir)
|
options.download_dir = normalize_path(options.download_dir)
|
||||||
|
|
||||||
ensure_dir(options.download_dir)
|
ensure_dir(options.download_dir)
|
||||||
|
|
||||||
session = self.get_default_session(options)
|
session = self.get_default_session(options)
|
||||||
|
|
|
@ -353,20 +353,6 @@ class RequirementPreparer(object):
|
||||||
# Previous "header" printed for a link-based InstallRequirement
|
# Previous "header" printed for a link-based InstallRequirement
|
||||||
self._previous_requirement_header = ("", "")
|
self._previous_requirement_header = ("", "")
|
||||||
|
|
||||||
@property
|
|
||||||
def _download_should_save(self):
|
|
||||||
# type: () -> bool
|
|
||||||
if not self.download_dir:
|
|
||||||
return False
|
|
||||||
|
|
||||||
if os.path.exists(self.download_dir):
|
|
||||||
return True
|
|
||||||
|
|
||||||
logger.critical('Could not find download directory')
|
|
||||||
raise InstallationError(
|
|
||||||
"Could not find or access download directory '{}'"
|
|
||||||
.format(self.download_dir))
|
|
||||||
|
|
||||||
def _log_preparing_link(self, req):
|
def _log_preparing_link(self, req):
|
||||||
# type: (InstallRequirement) -> None
|
# type: (InstallRequirement) -> None
|
||||||
"""Provide context for the requirement being prepared."""
|
"""Provide context for the requirement being prepared."""
|
||||||
|
@ -568,9 +554,9 @@ class RequirementPreparer(object):
|
||||||
download_path = display_path(download_location)
|
download_path = display_path(download_location)
|
||||||
logger.info('Saved %s', download_path)
|
logger.info('Saved %s', download_path)
|
||||||
|
|
||||||
if self._download_should_save:
|
if link.is_vcs:
|
||||||
# Make a .zip of the source_dir we already created.
|
# Make a .zip of the source_dir we already created.
|
||||||
if link.is_vcs:
|
if self.download_dir is not None:
|
||||||
req.archive(self.download_dir)
|
req.archive(self.download_dir)
|
||||||
return dist
|
return dist
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue