Skip to content

Commit a6c05fd

Browse files
committed
Improve presentation of non-verbose downloads with non-PyPI indexes
1 parent 7f76f2b commit a6c05fd

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/pip/_internal/network/download.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ def _log_download(
5151
total_length: int | None,
5252
range_start: int | None = 0,
5353
) -> Iterable[bytes]:
54-
if link.netloc == PyPI.file_storage_domain:
55-
url = link.show_url
56-
else:
54+
if logger.getEffectiveLevel() > logging.INFO:
5755
url = link.url_without_fragment
56+
else:
57+
url = link.show_url
5858

5959
logged_url = redact_auth_from_url(url)
6060

tests/unit/test_network_download.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,21 @@
3030
{},
3131
False,
3232
None,
33-
"Downloading http://example.com/foo.tgz",
33+
"Downloading foo.tgz",
3434
),
3535
(
3636
"http://example.com/foo.tgz",
3737
{"content-length": "2"},
3838
False,
3939
None,
40-
"Downloading http://example.com/foo.tgz (2 bytes)",
40+
"Downloading foo.tgz (2 bytes)",
4141
),
4242
(
4343
"http://example.com/foo.tgz",
4444
{"content-length": "2"},
4545
True,
4646
None,
47-
"Using cached http://example.com/foo.tgz (2 bytes)",
47+
"Using cached foo.tgz (2 bytes)",
4848
),
4949
(
5050
"https://files.pythonhosted.org/foo.tgz",
@@ -72,7 +72,7 @@
7272
{"content-length": "200"},
7373
False,
7474
100,
75-
"Resuming download http://example.com/foo.tgz (100 bytes/200 bytes)",
75+
"Resuming download foo.tgz (100 bytes/200 bytes)",
7676
),
7777
],
7878
)

0 commit comments

Comments
 (0)