Skip to content

Commit 58f6136

Browse files
committed
cli.cmdoptions: Add 'use_keyring' flag, defaulting to False
1 parent 4557a92 commit 58f6136

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/pip/_internal/cli/cmdoptions.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,15 @@ def _handle_no_use_pep517(option, opt, value, parser):
766766
help=SUPPRESS_HELP
767767
) # type: Any
768768

769+
use_keyring = partial(
770+
Option,
771+
'--use-keyring',
772+
dest='use_keyring',
773+
action='store_true',
774+
default=False,
775+
help="Attempt to get credentials from the user's keyring."
776+
) # type: Any
777+
769778
install_options = partial(
770779
Option,
771780
'--install-option',

src/pip/_internal/cli/req_command.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ def _build_session(self, options, retries=None, timeout=None):
9090
),
9191
retries=retries if retries is not None else options.retries,
9292
trusted_hosts=options.trusted_hosts,
93+
use_keyring=options.use_keyring,
9394
index_urls=self._get_index_urls(options),
9495
)
9596

0 commit comments

Comments
 (0)