Skip to content

Commit 510f490

Browse files
committed
network.auth.MultiDomainBasicAuth: Allow disabling keyring
Kept it enabled by default, so as not to break tests.
1 parent 2914cb4 commit 510f490

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/pip/_internal/network/auth.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ def get_keyring_auth(cls, url, username):
8787
cls._keyring = None
8888
return None
8989

90-
91-
def __init__(self, prompting=True, index_urls=None):
92-
# type: (bool, Optional[List[str]]) -> None
90+
def __init__(self, use_keyring=True, prompting=True, index_urls=None):
91+
# type: (bool, bool, Optional[List[str]]) -> None
9392
self.prompting = prompting
9493
self.index_urls = index_urls
94+
self.use_keyring = use_keyring
9595
self.passwords = {} # type: Dict[str, AuthInfo]
9696
# When the user is prompted to enter credentials and keyring is
9797
# available, we will offer to save them. If the user accepts,
@@ -162,7 +162,7 @@ def _get_new_credentials(self, original_url, allow_netrc=True,
162162
return netrc_auth
163163

164164
# If we don't have a password and keyring is available, use it.
165-
if allow_keyring:
165+
if allow_keyring and self.use_keyring:
166166
# The index url is more specific than the netloc, so try it first
167167
kr_auth = (
168168
self.get_keyring_auth(index_url, username) or

0 commit comments

Comments
 (0)