Skip to content

Allow generation of pyi files for python .py modules

David Gobbi requested to merge dgobbi/vtk:python-pyi-cleanup into master

This change allows vtk_generate_pyi.py to generate .pyi files for ordinary .py modules.

By default, vtk_generate_pyi.py only generates .pyi files for extension modules (specifically, for the wrapped VTK modules). It does this because .pyi files are the only way to attach type annotation to extension modules.

However, it can still be useful to generate .pyi files for ordinary .py modules, as long as the classes they contain are extension types. The best example of this is vtkmodules/all.py. But generation of all.pyi is not done by default, because it is not necessary for all IDEs (some IDEs can figure out what modules the classes in all.py were originally defined in, and grab the type annotations from the .pyi files for those modules).

Merge request reports