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

Adjust the Fallback logic for obtaining the hashes from private indexes #5866

Merged
merged 7 commits into from
Aug 25, 2023
Next Next commit
Adjust the Fallback logic for obtaining the hashes from private indexes
  • Loading branch information
matteius committed Aug 25, 2023
commit e2d2088d4556eb5d397f9561cc8175acc615d7f8
5 changes: 2 additions & 3 deletions pipenv/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from json.decoder import JSONDecodeError
from pathlib import Path
from urllib import parse
from urllib.parse import unquote
from urllib.parse import unquote, urljoin

from pipenv.utils.constants import VCS_LIST

Expand Down Expand Up @@ -315,8 +315,7 @@ def get_hashes_from_remote_index_urls(self, ireq, source):
if params_dict.get(FAVORITE_HASH):
collected_hashes.add(params_dict[FAVORITE_HASH][0])
else: # Fallback to downloading the file to obtain hash
if source["url"] not in package_url:
package_url = f"{source['url']}{package_url}"
package_url = urljoin(source["url"], package_url)
link = Link(package_url)
collected_hashes.add(self.get_file_hash(session, link))
return self.prepend_hash_types(collected_hashes, FAVORITE_HASH)
Expand Down