Skip to content

Commit

Permalink
Added a news entry and some documentation about `--keyring-does-not-p…
Browse files Browse the repository at this point in the history
…rompt`
  • Loading branch information
Darsstar committed Apr 18, 2022
1 parent ab6ab97 commit 89a4822
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/html/topics/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,25 @@ $ echo "your-password" | keyring set pypi.company.com your-username
$ pip install your-package --index-url https://pypi.company.com/
```

Pip does not query `keyring` for credentials when `--no-input` is used unless
`--keyring-does-not-prompt` is used as well. `keyring` backends might not
require any user interaction at all, they might prompt for more information on
the console, or they could do things like trigger a security notification on a
mobile device which needs to be approved. That is why Pip has to be
conservative and users should be confident their configured backend requires no
user input.
Tools such as Pipx and Pipenv which either show a fancy progress indicator that
hides output from the Pip subprocess, or pass `--no-input` to the Pip
subprocess (or do both) are a situation where you will want to do some variant
of the following since it does not require support from the tool:

```bash
# possibly with --user, --global or --site
$ pip config set global.keyring-does-not-prompt true
# or
$ export PIP_KEYRING_DOES_NOT_PROMPT=1
```

Note that `keyring` (the Python package) needs to be installed separately from
pip. This can create a bootstrapping issue if you need the credentials stored in
the keyring to download and install keyring.
Expand Down
1 change: 1 addition & 0 deletions news/11020.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add ``--keyring-does-not-prompt`` flag which allows ``keyring`` lookups in combination with ``--no-input``. See the Authentication page in the documentation for more info.

0 comments on commit 89a4822

Please sign in to comment.