Skip to content

Commit 89a4822

Browse files
committed
Added a news entry and some documentation about --keyring-does-not-prompt
1 parent ab6ab97 commit 89a4822

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

docs/html/topics/authentication.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,25 @@ $ echo "your-password" | keyring set pypi.company.com your-username
7474
$ pip install your-package --index-url https://pypi.company.com/
7575
```
7676

77+
Pip does not query `keyring` for credentials when `--no-input` is used unless
78+
`--keyring-does-not-prompt` is used as well. `keyring` backends might not
79+
require any user interaction at all, they might prompt for more information on
80+
the console, or they could do things like trigger a security notification on a
81+
mobile device which needs to be approved. That is why Pip has to be
82+
conservative and users should be confident their configured backend requires no
83+
user input.
84+
Tools such as Pipx and Pipenv which either show a fancy progress indicator that
85+
hides output from the Pip subprocess, or pass `--no-input` to the Pip
86+
subprocess (or do both) are a situation where you will want to do some variant
87+
of the following since it does not require support from the tool:
88+
89+
```bash
90+
# possibly with --user, --global or --site
91+
$ pip config set global.keyring-does-not-prompt true
92+
# or
93+
$ export PIP_KEYRING_DOES_NOT_PROMPT=1
94+
```
95+
7796
Note that `keyring` (the Python package) needs to be installed separately from
7897
pip. This can create a bootstrapping issue if you need the credentials stored in
7998
the keyring to download and install keyring.

news/11020.feature.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
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 commit comments

Comments
 (0)