diff --git a/news/b356d29d-cc4a-4949-90b2-220361044a10.trivial.rst b/news/b356d29d-cc4a-4949-90b2-220361044a10.trivial.rst new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/pip/_internal/operations/prepare.py b/src/pip/_internal/operations/prepare.py index c5e4f508c5f..2b838a01962 100644 --- a/src/pip/_internal/operations/prepare.py +++ b/src/pip/_internal/operations/prepare.py @@ -8,7 +8,7 @@ import mimetypes import os import shutil -from typing import Dict, Iterable, List, Optional, Tuple +from typing import Dict, Iterable, List, Optional from pip._vendor.packaging.utils import canonicalize_name from pip._vendor.pkg_resources import Distribution @@ -319,8 +319,8 @@ def __init__( # Should in-tree builds be used for local paths? self.in_tree_build = in_tree_build - # Memoized downloaded files, as mapping of url: (path, mime type) - self._downloaded: Dict[str, Tuple[str, str]] = {} + # Memoized downloaded files, as mapping of url: path. + self._downloaded: Dict[str, str] = {} # Previous "header" printed for a link-based InstallRequirement self._previous_requirement_header = ("", "") @@ -487,7 +487,7 @@ def prepare_linked_requirement( if file_path is not None: # The file is already available, so mark it as downloaded - self._downloaded[req.link.url] = file_path, None + self._downloaded[req.link.url] = file_path else: # The file is not available, attempt to fetch only metadata wheel_dist = self._fetch_metadata_using_lazy_wheel(link) @@ -509,7 +509,7 @@ def prepare_linked_requirements_more( hashes = self._get_linked_req_hashes(req) file_path = _check_download_dir(req.link, self.download_dir, hashes) if file_path is not None: - self._downloaded[req.link.url] = file_path, None + self._downloaded[req.link.url] = file_path req.needs_more_preparation = False # Prepare requirements we found were already downloaded for some @@ -550,10 +550,10 @@ def _prepare_linked_requirement( 'error {} for URL {}'.format(req, exc, link) ) else: - file_path, content_type = self._downloaded[link.url] + file_path = self._downloaded[link.url] if hashes: hashes.check_against_path(file_path) - local_file = File(file_path, content_type) + local_file = File(file_path, content_type=None) # For use in later processing, # preserve the file path on the requirement.