11#!/usr/bin/env python3
2- """Prune UI-interactor subpackages from the generated wheel build tree.
2+ """Prune dead UI-interactor subpackages from the generated wheel build tree.
33
4- PyVista never imports the gtk/qt/tk/wx/test helper subpackages (its Qt path is
5- the separate pyvistaqt package), but VTK's generated setup.py hardcodes them in
6- ``packages=[...]``. Remove both the directories and the setup.py references so
7- ``setup.py bdist_wheel`` doesn't fail on missing dirs. Mirrors the same step in
8- build-fvtk.sh.
4+ PyVista never imports the gtk/tk/wx/test helper subpackages, but VTK's generated
5+ setup.py hardcodes them in ``packages=[...]``. Remove both the directories and the
6+ setup.py references so ``setup.py bdist_wheel`` doesn't fail on missing dirs.
7+ Mirrors the same step in build-fvtk.sh.
8+
9+ The ``qt`` subpackage is deliberately KEPT: pyvistaqt imports ``vtkmodules.qt``
10+ (redirected to ``fvtk.qt``) for ``PyQtImpl`` / ``QVTKRenderWindowInteractor``, and
11+ dropping it breaks pyvistaqt at import time (gh-142). It is pure Python and pulls
12+ in no Qt binding unless one is already imported, so shipping it is free.
913
1014Usage: python ci/prune_setup_py.py <build_dir>
1115"""
1620import shutil
1721import sys
1822
19- SUBPACKAGES = ("gtk" , "qt" , " tk" , "wx" , "test" )
23+ SUBPACKAGES = ("gtk" , "tk" , "wx" , "test" )
2024
2125
2226def main (build_dir : str ) -> int :
@@ -38,7 +42,7 @@ def main(build_dir: str) -> int:
3842 with open (setup_py , "r" , encoding = "utf-8" ) as fh :
3943 text = fh .read ()
4044 pat = re .compile (
41- r"^.*'(?:vtkmodules|fvtk)\.(?:gtk|qt| tk|wx|test)',?.*$\n?" ,
45+ r"^.*'(?:vtkmodules|fvtk)\.(?:gtk|tk|wx|test)',?.*$\n?" ,
4246 re .MULTILINE ,
4347 )
4448 new_text , n = pat .subn ("" , text )
0 commit comments