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

Check for name attribute in source parameter. #6114

Merged
merged 1 commit into from
Mar 27, 2024
Merged
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
4 changes: 4 additions & 0 deletions pipenv/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ def get_package_categories(self, for_lockfile=False):
return ["packages", "dev-packages"] + list(package_categories)

def get_requests_session_for_source(self, source):
if not (source and source.get("name")):
return None
if self.sessions.get(source["name"]):
session = self.sessions[source["name"]]
else:
Expand Down Expand Up @@ -268,6 +270,8 @@ def get_hash_from_link(self, hash_cache, link):
def get_hashes_from_pypi(self, ireq, source):
pkg_url = f"https://pypi.org/pypi/{ireq.name}/json"
session = self.get_requests_session_for_source(source)
if not session:
return None
try:
collected_hashes = set()
# Grab the hashes from the new warehouse API.
Expand Down
Loading