Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • VTK VTK
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 876
    • Issues 876
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 234
    • Merge requests 234
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Terraform modules
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • VTKVTK
  • VTKVTK
  • Issues
  • #18321
Closed
Open
Issue created Sep 28, 2021 by Ievgen Popovych@Jmennius

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:

  1. VTK has a lot of modules and ideally we'd have multiple hook files (one hook per VTK module), which is a lot.
  2. Figuring out hidden dependencies and manually making hooks is very tedious (I am not even sure how to figure out those 'imports' yet).
  3. I saw that in this repository there is probably enough information (about module dependencies) to generate hooks automatically at (wheel) build time.
  4. 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:

  1. 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)
  2. 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.

Assignee
Assign to
Time tracking