Skip to content

Commit

Permalink
cli.cmdoptions: Add 'use_keyring' flag, defaulting to False
Browse files Browse the repository at this point in the history
  • Loading branch information
nbraud committed Feb 1, 2021
1 parent 4557a92 commit 58f6136
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/pip/_internal/cli/cmdoptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,15 @@ def _handle_no_use_pep517(option, opt, value, parser):
help=SUPPRESS_HELP
) # type: Any

use_keyring = partial(
Option,
'--use-keyring',
dest='use_keyring',
action='store_true',
default=False,
help="Attempt to get credentials from the user's keyring."
) # type: Any

install_options = partial(
Option,
'--install-option',
Expand Down
1 change: 1 addition & 0 deletions src/pip/_internal/cli/req_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ def _build_session(self, options, retries=None, timeout=None):
),
retries=retries if retries is not None else options.retries,
trusted_hosts=options.trusted_hosts,
use_keyring=options.use_keyring,
index_urls=self._get_index_urls(options),
)

Expand Down

0 comments on commit 58f6136

Please sign in to comment.