-
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
Add cli flag --force-keyring #11029
Add cli flag --force-keyring #11029
Conversation
If you supply the flag, but the keyring backend does prompt for user input (somehow, maybe via a GUI), what happens? I can imagine people using this flag getting very confused when the pip process "hangs" and reporting issues. In my experience, authentication prompts are notorious for "mostly" not needing user interaction, but then unexpectedly popping up prompts. The git client definitely does this - upgrading git often causes re-prompts, for example. And a keyring that periodically prompts for security reasons seems perfectly plausible to me. So it would be easy for a user to think that it's OK to supply this flag, but be wrong. Also, the paragraph in the documentation about pipx/pipenv isn't at all clear to me. It seems to suggest that if you use those tools, you should always set this flag - which frankly seems like the wrong message to be giving. Maybe this would be better handled as a |
That does sound like a more sensible name and way to document the feature. Time for a break tohopefully quicky stop being disapointed in myself not for realizing this myself after @uranusjr suggested |
89a4822
to
94a0941
Compare
I renamed the flag to |
|
94a0941
to
854accb
Compare
Woops. Fixed it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementation looks good. Don’t have much opinion on the design, leaving it for others to comment on.
854accb
to
113d1a9
Compare
@uranusjr It has been two months without any sign of Pip contributors doing so without any asking them to. Would pinging people or a team be reasonable at this point? (The latter is not something I can do as far as I can tell.) |
I'm much the same as @uranusjr - the implementation looks OK, but I don't have much opinion on the design. Basically, I don't mind if someone else merges this, but I won't do so myself. |
Moving this to the 23.0 milestone. |
113d1a9
to
82cc63c
Compare
82cc63c
to
11c1a10
Compare
bc1db24
to
f255bfe
Compare
f255bfe
to
77b8bbd
Compare
77b8bbd
to
01b74b4
Compare
01b74b4
to
185a579
Compare
185a579
to
cdb5756
Compare
…keyring queried for credentials. Since there is currently no possible way to get pip to query the keyring when --no-input is used I am not marking the new scenario xfail. That should change once there is some way to do that.
Currently, 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. This commit adds a flag to force keyring usage if it is installed. It defaults to `False`, making this opt-in behaviour. Tools such as Pipx and Pipenv use Pip and have their own progress indicator that hides output from the subprocess Pip runs in. They should pass `--no-input` in my opinion, but Pip should provide some mechanism to still query the keyring in that case. Just not by default. So here we are.
…r_keyring_if_needed to add a few --no-input and --force-keyring scenarios
cdb5756
to
b4082e3
Compare
…-defined]` comments that are no longer needed as of pytest 7.1.3
b4082e3
to
7fd045c
Compare
I don't have the bandwidth to review/decide what to do on this PR and, TBH, I'm not too sure about breaking behaviour change here without a migration period (x-ref https://pip.pypa.io/en/stable/development/release-process/#deprecation-policy). What do we want to do here folks? |
If I do as @uranusjr suggests in #11698 then this PR will become irrelevant and only I can have that refactor done in the next couple of days. Not that that will magically give you more bandwith to deal with that PR... Could you at least take a quick look at #11658 which is about a tiny bug in new keyring related functionality on HEAD? |
Oh, this sounds great and I agree. :)
Have added it to the 23.0 milestone for now. That's a relatively easy fix, I think but if we can cover that as part of this PR, that works for me too. :) |
I'm done with the refactoring. I'm going to selfishly leave this PR open for now since this one is on de 23.0 milestone and the other is not so it serves as a reminder. |
Closing in favor of #11698 |
Fixes #11020
Fixes #11658
Currently, 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.
These commits add a flag to pinky swear that the configured keyring backend does not require any user interaction. It defaults to False, making this opt-in behaviour.
Tools such as Pipx and Pipenv use Pip and have their own progress indicator that hides output from the subprocess Pip runs in. They should pass --no-input in my opinion, but Pip should provide some mechanism to still query the keyring in that case. Just not by default. So here we are.