8
8
import mimetypes
9
9
import os
10
10
import shutil
11
- from typing import Dict , Iterable , List , Optional , Tuple
11
+ from typing import Dict , Iterable , List , Optional
12
12
13
13
from pip ._vendor .packaging .utils import canonicalize_name
14
14
from pip ._vendor .pkg_resources import Distribution
@@ -319,8 +319,8 @@ def __init__(
319
319
# Should in-tree builds be used for local paths?
320
320
self .in_tree_build = in_tree_build
321
321
322
- # Memoized downloaded files, as mapping of url: ( path, mime type)
323
- self ._downloaded : Dict [str , Tuple [ str , str ] ] = {}
322
+ # Memoized downloaded files, as mapping of url: path.
323
+ self ._downloaded : Dict [str , str ] = {}
324
324
325
325
# Previous "header" printed for a link-based InstallRequirement
326
326
self ._previous_requirement_header = ("" , "" )
@@ -487,7 +487,7 @@ def prepare_linked_requirement(
487
487
488
488
if file_path is not None :
489
489
# The file is already available, so mark it as downloaded
490
- self ._downloaded [req .link .url ] = file_path , None
490
+ self ._downloaded [req .link .url ] = file_path
491
491
else :
492
492
# The file is not available, attempt to fetch only metadata
493
493
wheel_dist = self ._fetch_metadata_using_lazy_wheel (link )
@@ -509,7 +509,7 @@ def prepare_linked_requirements_more(
509
509
hashes = self ._get_linked_req_hashes (req )
510
510
file_path = _check_download_dir (req .link , self .download_dir , hashes )
511
511
if file_path is not None :
512
- self ._downloaded [req .link .url ] = file_path , None
512
+ self ._downloaded [req .link .url ] = file_path
513
513
req .needs_more_preparation = False
514
514
515
515
# Prepare requirements we found were already downloaded for some
@@ -550,10 +550,10 @@ def _prepare_linked_requirement(
550
550
'error {} for URL {}' .format (req , exc , link )
551
551
)
552
552
else :
553
- file_path , content_type = self ._downloaded [link .url ]
553
+ file_path = self ._downloaded [link .url ]
554
554
if hashes :
555
555
hashes .check_against_path (file_path )
556
- local_file = File (file_path , content_type )
556
+ local_file = File (file_path , content_type = None )
557
557
558
558
# For use in later processing,
559
559
# preserve the file path on the requirement.
0 commit comments