Skip to content

Commit

Permalink
network.session: Add an enable_keyring option, defaulting to false
Browse files Browse the repository at this point in the history
Closes pypa#8719
  • Loading branch information
nbraud committed Jan 6, 2021
1 parent 672a6a2 commit 525efa0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/pip/_internal/network/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ def __init__(self, *args, **kwargs):
cache = kwargs.pop("cache", None)
trusted_hosts = kwargs.pop("trusted_hosts", []) # type: List[str]
index_urls = kwargs.pop("index_urls", None)
enable_keyring = kwargs.pop("enable_keyring", False)

super().__init__(*args, **kwargs)

Expand All @@ -245,7 +246,10 @@ def __init__(self, *args, **kwargs):
self.headers["User-Agent"] = user_agent()

# Attach our Authentication handler to the session
self.auth = MultiDomainBasicAuth(index_urls=index_urls)
self.auth = MultiDomainBasicAuth(
enable_keyring=enable_keyring,
index_urls=index_urls,
)

# Create our urllib3.Retry instance which will allow us to customize
# how we handle retries.
Expand Down

0 comments on commit 525efa0

Please sign in to comment.