-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pip still prompts for username/password even when keyring is configured #12661
Comments
This fixes pypa#12543 (and probably pypa#12661). Somewhat confusingly, when using using `PIP_KEYRING_PROVIDER=import`, pip was able to fetch both a username and a password from keyring, but when using `PIP_KEYRING_PROVIDER=subprocess`, it needed the username. I opted not to write a new test for this, as the existing [test_prompt_for_keyring_if_needed](https://github.com/pypa/pip/blob/86b8b23c1eaaac5c420a28519daf91de830f1182/tests/functional/test_install_config.py#L392) feels sufficient to me. TODO/need feedback: - I haven't implemented any "feature detection" to see if the `keyring` subprocess supports `--mode=creds`. This feature was added quite recently (jaraco/keyring@7830a64 landed in keyring v25.2.0). It looks like there's an older `getcreds` subcommand which we could probably feature detect as well. I personally would inclined to keep things simple and only support the latest version of the `keyring` cli, but I will gladly implement whatever y'all think is best. - Should I add a news entry about this?
This fixes pypa#12543 (and probably pypa#12661). Somewhat confusingly, when using using `PIP_KEYRING_PROVIDER=import`, pip was able to fetch both a username and a password from keyring, but when using `PIP_KEYRING_PROVIDER=subprocess`, it needed the username. I opted not to write a new test for this, as the existing [test_prompt_for_keyring_if_needed](https://github.com/pypa/pip/blob/86b8b23c1eaaac5c420a28519daf91de830f1182/tests/functional/test_install_config.py#L392) feels sufficient to me. TODO/need feedback: - I haven't implemented any "feature detection" to see if the `keyring` subprocess supports `--mode=creds`. This feature was added quite recently (jaraco/keyring@7830a64 landed in keyring v25.2.0). It looks like there's an older `getcreds` subcommand which we could probably feature detect as well. I personally would inclined to keep things simple and only support the latest version of the `keyring` cli, but I will gladly implement whatever y'all think is best. - Should I add a news entry about this?
This fixes pypa#12543 (and probably pypa#12661). Somewhat confusingly, when using using `PIP_KEYRING_PROVIDER=import`, pip was able to fetch both a username and a password from keyring, but when using `PIP_KEYRING_PROVIDER=subprocess`, it needed the username. I opted not to write a new test for this, as the existing [test_prompt_for_keyring_if_needed](https://github.com/pypa/pip/blob/86b8b23c1eaaac5c420a28519daf91de830f1182/tests/functional/test_install_config.py#L392) feels sufficient to me. TODO/need feedback: - I haven't implemented any "feature detection" to see if the `keyring` subprocess supports `--mode=creds`. This feature was added quite recently (jaraco/keyring@7830a64 landed in keyring v25.2.0). It looks like there's an older `getcreds` subcommand which we could probably feature detect as well. I personally would inclined to keep things simple and only support the latest version of the `keyring` cli, but I will gladly implement whatever y'all think is best.
Edit: nevermind, I was wrong: @Time0o is using
|
The reproducer includes |
Description
I'm trying to download a package from a GitLab registry using credentials stored via keyring. I believe I am following the documentation but pip neither uses the keyring credentials nor displays an error and instead just prompts for username/password.
Expected behavior
pip uses the credentials stored in keyring.
pip version
24.0
Python version
3.10.12
OS
Ubuntu 22.04.4 LTS
How to Reproduce
read_api
rightspip install --keyring-provider import -i https://gitlab.com/api/v4/groups/<MY_GROUP_ID>/-/packages/pypi/simple <MY_PACKAGE>
Output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: