Skip to content

Import _vtkmodules_static explicitly, and add __all__ to vtkmodules

David Gobbi requested to merge dgobbi/vtk:vtkmodules-all into master

Since __init__.py is now a generated file, it makes sense for cmake to decide whether to import _vtkmodules_static, rather than rely on trial-and-error. The try/except handling caused a lot of confusion among users, since failure to import vtkCommonCore would result in an error message about _vtkmodules_static.

This MR also adds an __all__ attribute, which provides a useful way of introspecting vtkmodules without having to import its submodules. It tells us what VTK modules were configured and wrapped.

This could potentially cause problems if we ever split VTK into smaller pieces for distribution, but I still want this out there for consideration (the same issue exists for the already-present vtkmodules/all.py).

Edited by David Gobbi

Merge request reports