Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show shorter details of the URL when downloading from PyPI #7225

Merged
merged 3 commits into from
Oct 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/7225.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Show only the filename (instead of full URL), when downloading from PyPI.
2 changes: 1 addition & 1 deletion src/pip/_internal/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def written_chunks(chunks):

progress_indicator = _progress_indicator

if link.netloc == PyPI.netloc:
if link.netloc == PyPI.file_storage_domain:
url = link.show_url
else:
url = link.url_without_fragment
Expand Down
9 changes: 8 additions & 1 deletion tests/functional/test_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def test_basic_install_from_pypi(script):
"""
Test installing a package from PyPI.
"""
result = script.pip('install', '-vvv', 'INITools==0.2')
result = script.pip('install', 'INITools==0.2')
egg_info_folder = (
script.site_packages / 'INITools-0.2-py%s.egg-info' % pyversion
)
Expand All @@ -238,6 +238,13 @@ def test_basic_install_from_pypi(script):
assert "Looking in indexes: " not in result.stdout
assert "Looking in links: " not in result.stdout

# Ensure that we don't print the full URL.
# The URL should be trimmed to only the last part of the path in it,
# when installing from PyPI. The assertion here only checks for
# `https://` since that's likely to show up if we're not trimming in
# the correct circumstances.
assert "https://" not in result.stdout


def test_basic_editable_install(script):
"""
Expand Down