Provide PyInstaller hooks
PyInstaller is a project that bundles all the dependencies and sources of a python application into an executable.
When using VTK (python bindings) in application that is bundled and executed - one will encounter a runtime error of 'module not found'.
This is because most of VTK functionality is provided in extension modules for which PyInstaller can't automatically find internal dependencies (on other python modules/extensions; dynamic loader dependencies are handled correctly).
To handle such situation, PyInstaller provides a mechanism called hooks, where one basically provides a file per-module where all 'hidden' dependencies/modules (i.e. those pyinstaller can't find) of a module are listed.
Now, hook for VTK was part of pyinstaller for a long time (in main repo), but VTK 8.2.0 modules require a change to the hook. There are few reason why I've come here and not just updated the existing hook:
- VTK has a lot of modules and ideally we'd have multiple hook files (one hook per VTK module), which is a lot.
- Figuring out hidden dependencies and manually making hooks is very tedious (I am not even sure how to figure out those 'imports' yet).
- I saw that in this repository there is probably enough information (about module dependencies) to generate hooks automatically at (wheel) build time.
- PyInstaller hooks can also be provided by the python package itself (via entry points), which means VTK python wheel can provide pyinstaller hooks.
With regards to all this, I have a few questions:
- Would you be willing to accept that into the repository? (some code (CMake?) that generates hook files at build time and a few lines into setup.py to refer to those entry-points)
- Can you give me a few pointers into the repository how can I approach this? (how to reliably understand on which extensions a module depends, where to put hook generation-code)
Thanks.