Closed gwiedeman closed 2 years ago
Poked at this a bit more and it looks like with pyinstaller the formats and derivative registries don't load.
If you have $MAILBAG_LOG_LEVEL
set to debug
, then it logs these registries. It logs both registries correctly when building the .exe, but when you actually run the .exe, it logs them both as empty dicts.
In other words, this issue prevents both mailbagit
and mailbagit-gui
from running as pyinstaller executables and I don't know a work around at this point.
Hmmmm. It's weird that the same problem happens without --onefile - I'd honestly expect it to happen with --onefile, due to it packing everything into the exe...
So, I think there's one way potentially around it - we could import the derivatives and formats included with mailbag directly (rather than using the mechanism we use for ones provided by users. It's a little cumbersome and we'd need to keep track as we added them rather than just automatically getting new ones picked up bc of the registry, but it should eliminate the issue (because they'll be imported normally)
addressed by #182
Describe the bug The GUI works fine natively in python, but after compiling it with pyinstaller, the format and derivative registries don't load correctly, so the
input_types
andderivative_types
variables in__init__.py
are empty lists. This makes no options available in the GUI. This also affectsmailbagit.exe
as well since it checks against those empty lists and raises an error when it doesn't include them, but I think that is more easily addressed.To Reproduce Steps to reproduce the behavior:
pip install -e .[dev]
pyinstaller --onefile mailbagit-gui.py
(same without--onefile
)mailbagit-gui.exe
Expected behavior The GUI should list all possible parsers and derivatives for users. I imaging that it would be tough to have the .exe detect if
wkhtmltopdf
orgoogle-chrome
are installed, but I'd expect it to show all the formats and derivatives available at build time.Screenshots
Environment (please complete the following information): _ GUI or command line?: GUI