-
Notifications
You must be signed in to change notification settings - Fork 306
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
How to disable keyring #338
Comments
Code is here. You have a few options.
In that scenario, it will prompt for a password. |
Let's find someplace to add this to the documentation. |
I stumbled upon this again, but now I don't recall how information from #338 (comment) helped me, as I don't have an option to uninstall neither kwallet (I still would like to have some kde tools installed, even when I don't use it as desktop) nor python-keyring package (because that would try to uninstall twine as well). |
When I delete the kwalled database file and run twine again, I get window asking for setting up new wallet, and when I cancel it, twine still doesn't ask for a password:
|
@jaraco any tips? |
Well, that's annoying. In the Python ecosystem, this isn't a problem because keyring is an optional, "extra" dependency on twine. My intention was that only users that planned to use keyring and have it configured would actually be interested in installing it to their environment. It sounds like you have a system package manager that doesn't have that nuance and unconditionally requires keyring. So it does seem that perhaps this project or keyring should provide some way to disable keyring even when it's present and viable. And then I have to wonder - should the Python ecosystem assume the same, and make |
I figured it out.
Here's how to do it:
Test that it's working with
|
Keyring 15.1.0 provides an easier way to achieve what you're after, either through a command-line option that configures the environment or an environment variable you can set. See the above referenced issue for details.
I just realized the above recommendation to disable keyring on earlier versions wouldn't work at all... because under the hood, it's configuring a keyring that only exists on this latest release. So the best recommendation I have for older versions of keyring is in the previous comment. |
Thinking about the lingering documentation issue, I'm kinda torn. The best recommendation, to use |
Thanks for looking into this and I tried you suggestion from #338 (comment):
but it still doesn't make twine to ask for password. That said, I noticed that when I specify password via command line argument, it works (and keyring is not involved):
But one one needs to be more careful as this is prone to leaking the secrets ... |
I don't understand why that would be. get_password uses password_from_keyring_or_prompt as the prompt_strategy, which uses this logic to suppress all exceptions (emitting the warning we do see) and ultimately calling I think you'll need to trace the code to figure out why getpass.getpass isn't being called (or is being called and not doing anything). |
Added documentation about how to disable keyring. Refered pypa/twine#338 for it.
Added documentation about how to disable keyring. Refered pypa/twine#338 for it.
Terribly, “pip” has started popping up 3 dialog boxes that say “Enter password to unlock your login keyring” every time I try to install or uninstall something. This file stops pip’s bad behavior and returns it to installing and uninstalling without the popups. My guess is that pip now expects all users to be using a heavyweight desktop system, like Gnome, that uses the password they type at login to unlock a cryptographic store. It’s another mystery (that I won’t persue right now) how the popup finds the screen even when I set `DISPLAY=` to disable access to my desktop windowing system. Also interesting is that it takes the keyboard away from the windowing system, making it impossible to type in other windows. *Much* thanks to this GitHub comment for explaining what to do: pypa/twine#338 (comment)
I uninstalled keyring as recommended but now twine crashes with an error message that keyring is required.
would be far nicer if keyring were available via a command line option for those who like that sort of thing, and disabled by default so things just work for everyone. |
Ugh. Sorry to hear that. It looks like you've stumbled onto a behavior in pkg_resources where pkg_resources does some packaging validation before loading metadata, a behavior that's superseded by importlib.metadata. Please file a new bug report for that. |
I've started work on a patch that would avoid that undesirable behavior in #728. |
It must be optional which frontend of wallet/keyring to use. I want it to use gnome-keyring. And actually i have set the username and password in ~/.pypirc, why it's ignored? |
@jaraco, the
|
If you want it to use gnome keyring, then disabling keyring isn’t what you want. Keyring does it’s best to figure out which backend would be best for you but it doesn’t always work. Please have a look at the other issues and file a new one if those don’t help and you think it may be possible for keyring to detect that you prefer gnome.
That guidance is old. Did the disable docs in the readme not provide a workable option? If not, feel free to open a new issue. |
Twine supports keyring, but it's not clear to me how to use twine without this support. Is this implemented or do we just miss documentation?
The text was updated successfully, but these errors were encountered: