Skip to content

Commit

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

Pip is conservative and does not query keyring at all when `--no-input` is used
because the keyring might require user interaction such as prompting the user
on the console. You can force keyring usage by passing `--force-keyring` or one
of the following:

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

Be careful when doing this since it could cause tools such as Pipx and Pipenv
to appear to hang. They show their own progress indicator while hiding output
from the subprocess in which they run Pip. You won't know whether the keyring
backend is waiting the user input or not in such situations.

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 ``--force-keyring`` flag which allows ``keyring`` lookups in combination with ``--no-input``. See the Authentication page in the documentation for more info.

0 comments on commit 11c1a10

Please sign in to comment.