Skip to content

Commit 1dd0e15

Browse files
avoid using shallow wheels for non-remote file paths
1 parent 4e799cd commit 1dd0e15

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/pip/_internal/network/shallow/httpfile.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,16 @@
1313
from typing import Any, Optional
1414

1515

16+
def url_is_remote(url):
17+
# type: (str) -> bool
18+
return get_url_scheme(url) in ['http', 'https']
19+
20+
1621
class Url(namedtuple('Url', ['url'])):
1722

1823
def __new__(cls, url):
1924
# type: (str) -> Url
20-
scheme = get_url_scheme(url)
21-
assert scheme in ["http", "https"]
25+
assert not url_is_remote(url)
2226
return super(Url, cls).__new__(cls, url)
2327

2428

src/pip/_internal/operations/prepare.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
PreviousBuildDirError,
2626
VcsHashUnsupported,
2727
)
28+
from pip._internal.network.shallow.httpfile import url_is_remote
2829
from pip._internal.utils.filesystem import copy2_fixed
2930
from pip._internal.utils.hashes import MissingHashes
3031
from pip._internal.utils.logging import indent_log
@@ -406,7 +407,7 @@ def prepare_linked_requirement(
406407
download_dir = self.wheel_download_dir
407408

408409
if link.is_wheel:
409-
if self.use_shallow_wheels:
410+
if self.use_shallow_wheels and url_is_remote(link.url):
410411
return ShallowWheelDistribution(
411412
req, self.downloader, download_dir)
412413
if download_dir:

src/pip/_internal/req/req_set.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ def perform_all_final_hydration(self):
6868
return
6969

7070
exceptions = []
71+
7172
def do_hydrate(dist):
7273
# type: (DistributionNeedingFinalHydration) -> None
7374
try:

0 commit comments

Comments
 (0)