unioslo / mreg-cli

Command Line Interface for Mreg
GNU General Public License v3.0
2 stars 7 forks source link

Fix PyInstaller `host_submodules` imports #262

Closed pederhan closed 4 months ago

pederhan commented 4 months ago

This PR fixes the built PyInstaller binaries not including the host_submodules commands.

Currently we get this:

mreg-test.uio.no> host info
usage: mreg-cli [-h] <command> ...
mreg-cli: error: unrecognized arguments: info

This happens because even though PyInstaller follows the mreg_cli.commands.host_submodules import, it cannot infer that it should import every module in the host_submodules namespace unless we explicitly perform an import of them in __init__.py.

pederhan commented 4 months ago

If we first list them manually, we can also do that during the original usage. But, this works. :)

Sure, but then it becomes a bit harder to ensure we actually import all the submodules as opposed to checking __all__ in a unit test.

I will merge this for now, then we can look to improve it down the line.