Skip to content

MAINT: Compat with traitsui 8#1255

Merged
prabhuramachandran merged 2 commits into
enthought:masterfrom
larsoner:traitsui
May 26, 2023
Merged

MAINT: Compat with traitsui 8#1255
prabhuramachandran merged 2 commits into
enthought:masterfrom
larsoner:traitsui

Conversation

@larsoner
Copy link
Copy Markdown
Collaborator

Hopefully fixes stuff like this:

______________________________ test_kit2fiff_gui _______________________________
mne_kit_gui/tests/test_kit2fiff_gui.py:123: in test_kit2fiff_gui
    ui, frame = mne_kit_gui.kit2fiff()
mne_kit_gui/__init__.py:69: in kit2fiff
    from ._kit2fiff_gui import Kit2FiffFrame
mne_kit_gui/_kit2fiff_gui.py:27: in <module>
    from tvtk.pyface.scene_editor import SceneEditor
/usr/local/miniconda/envs/mne-kit-gui/lib/python3.11/site-packages/tvtk/pyface/scene_editor.py:12: in <module>
    SceneEditor = toolkit_object('scene_editor:SceneEditor')
/usr/local/miniconda/envs/mne-kit-gui/lib/python3.11/site-packages/pyface/base_toolkit.py:127: in __call__
    module = import_module(mname, package)
/usr/local/miniconda/envs/mne-kit-gui/lib/python3.11/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
/usr/local/miniconda/envs/mne-kit-gui/lib/python3.11/site-packages/tvtk/pyface/ui/qt4/scene_editor.py:16: in <module>
    from traitsui.qt4.editor import Editor
E   ModuleNotFoundError: No module named 'traitsui.qt4.editor'

@larsoner
Copy link
Copy Markdown
Collaborator Author

Also updated CIs to use pyvista/setup-headless-display-action which I maintain for use by several packages to ensure Qt5/6 work on GitHub actions for Linux without manually needing to fire up or use an Xvfb-specific action and update packages manually anymore

@prabhuramachandran
Copy link
Copy Markdown
Member

@larsoner Thank youvery much for this! I have been swamped and will not be able to get to a proper fix until early June but in the meanwhile this looks good so I will review and merge away. I will need to do this: #1228 which I will do once I am back.

Copy link
Copy Markdown
Member

@prabhuramachandran prabhuramachandran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, and it fixes the failing builds on Linux. thanks! I will work on better pyface/traitsui8 support later.

@prabhuramachandran prabhuramachandran merged commit f953885 into enthought:master May 26, 2023
@corranwebster
Copy link
Copy Markdown

corranwebster commented May 26, 2023

Putting this here for reference in case anyone else runs into issues before the next Mayavi release: there is also a "backwards compatibility" import hook for Pyface and TraitsUI which allows the *.qt4.* imports to work:

  • use ETS_TOOLKIT=qt4 (as opposed to qt) or otherwise set the ETSConfig toolkit to "qt4"
  • set ETS_QT4_IMPORTS environment variable
  • some more complex magic involving adding pyface.ui.ShadowedModuleFinder to sys.meta_path for Pyface and TraitsUI.

@larsoner larsoner deleted the traitsui branch July 24, 2023 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants