Skip to content

Commit 113d1a9

Browse files
DarsstarDos Moonen
authored and
Dos Moonen
committed
Added a news entry and some documentation about --force-keyring
1 parent 3704649 commit 113d1a9

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

docs/html/topics/authentication.md

+19
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 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.force-keyring true
85+
# or
86+
$ export PIP_FORCE_KEYRING=1
87+
```
88+
89+
```{warning}
90+
Be careful when doing this since it could cause tools such as Pipx and Pipenv
91+
to appear to hang. They show their own progress indicator while hiding output
92+
from the subprocess in which they run Pip. You won't know whether the keyring
93+
backend is waiting the user input or not in such situations.
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

+1
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)