Skip to content

Commit 11c1a10

Browse files
committed
Added a news entry and some documentation about --force-keyring
1 parent a2867e0 commit 11c1a10

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

docs/html/topics/authentication.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,23 @@ $ 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 is conservative and does not query keyring at all when `--no-input` is used
78+
because the keyring might require user interaction such as prompting the user
79+
on the console. You can force keyring usage by passing `--force-keyring` or one
80+
of the following:
81+
82+
```bash
83+
# possibly with --user, --global or --site
84+
$ pip config set global.keyring-does-not-prompt true
85+
# or
86+
$ export PIP_KEYRING_DOES_NOT_PROMPT=1
87+
```
88+
89+
Be careful when doing this since it could cause tools such as Pipx and Pipenv
90+
to appear to hang. They show their own progress indicator while hiding output
91+
from the subprocess in which they run Pip. You won't know whether the keyring
92+
backend is waiting the user input or not in such situations.
93+
7794
Note that `keyring` (the Python package) needs to be installed separately from
7895
pip. This can create a bootstrapping issue if you need the credentials stored in
7996
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 ``--force-keyring`` 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)