-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Keyring hook does not work #4569
Comments
For reference for anyone who like me landed here out of the blue, @msk849 has submitted a PR for this issue, and until it makes its way to master to keyring release to pyinstaller to pyinstaller release to pypi, ...... there's a horrible workaround to get it to work right now that in theory you should not do, which is altering the library yourself with the contents of their PR directly in your own Open
with
which should be around line 199. Clear pyinstaler build and dist cache, rerun pyinstaller, and the error should be gone. |
@anasofiapaixao thanks for the update, I'm facing the same issue. My current workaround without changing the
|
Doesn't look like that Keyring PR is going to be merged, maintainers have mentioned that PyInstaller should supply the metadata so that other packages should be able to follow these instructions to discover the metadata. |
Newer Keyrings also fail to work in apps bundled with py2app. Can't find any workaround despite modifying the keyring lib. Monkey patching seems not to be possible. So I downgrade to |
BTW, stumbling upon this error myself while I'm also learning the Rust programming language (A systems language like C\C++), I've made an attempt to port Rust's own most popular keyring library to Python and it seems to be working fine with PyInstaller.
|
Turn the existing hook into a top-level hook, i.e., rename it from hook-keyring.backends.py to hook-keyring.py. In addition to collecting the backends, also copy the package's metadata. Fixes pyinstaller#4569.
Turn the existing hook into a top-level hook, i.e., rename it from hook-keyring.backends.py to hook-keyring.py. In addition to collecting the backends, also copy the package's metadata. Fixes pyinstaller#4569.
Turn the existing hook into a top-level hook, i.e., rename it from hook-keyring.backends.py to hook-keyring.py. In addition to collecting the backends, also copy the package's metadata, which is needed for backend discovery at run-time. Fixes pyinstaller#4569.
Thank you for your workaround. Does it support Linux platforms? Secret Service or KWallet? |
Since it was created mainly as a workaround for PyInstaller to create windows EXE, it was not well tested on Linux. It does compile on Linux and the underlying Edit: I have created this with a very fundemental understanding of the Rust language. As I'm getting to learn the langauge deeper, I will eventually create a complete bind supporting all features. For now, I'm open to PRs |
Turn the existing hook into a top-level hook, i.e., rename it from hook-keyring.backends.py to hook-keyring.py. In addition to collecting the backends, also copy the package's metadata, which is needed for backend discovery at run-time. Fixes pyinstaller#4569.
* expand test_keyring Instead instead of just importing the keyring module, try to get a password from it. Doing so will raise a keyring.errors.NoKeyringError if backends are not properly collected. This is skipped on Linux, due to the SecretStorage backend requiring an active D-BUS session and initialized keyring, and may need to unlock the keyring via UI prompt. These conditions are difficult to satisfy in automated test environments, so just skip the test on linux. * update keyring hook Turn the existing hook into a top-level hook, i.e., rename it from hook-keyring.backends.py to hook-keyring.py. In addition to collecting the backends, also copy the package's metadata, which is needed for backend discovery at run-time. Fixes #4569.
* expand test_keyring Instead instead of just importing the keyring module, try to get a password from it. Doing so will raise a keyring.errors.NoKeyringError if backends are not properly collected. This is skipped on Linux, due to the SecretStorage backend requiring an active D-BUS session and initialized keyring, and may need to unlock the keyring via UI prompt. These conditions are difficult to satisfy in automated test environments, so just skip the test on linux. * update keyring hook Turn the existing hook into a top-level hook, i.e., rename it from hook-keyring.backends.py to hook-keyring.py. In addition to collecting the backends, also copy the package's metadata, which is needed for backend discovery at run-time. Fixes pyinstaller#4569.
Environment:
Configure the virtualenv with keyring and pyinstaller
python3 -m venv venv source ./venv/bin/activate pip install keyring pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip
Have a simple file called
test.py
:This prints "None" when executed.
Package it and run:
Build log: https://pastebin.com/raw/VeEtsZge
Content of build and dist: https://www.dropbox.com/s/79s7fe8dpkij717/pyinstbug.tgz?dl=1
Result:
From the various logs it looks like keyring is somewhat detected, but then it's not actually fully imported at runtime. I have tried explicitly setting all keyring submodules as hiddenimports, it does not make any difference.
The text was updated successfully, but these errors were encountered: