enthought / envisage

Envisage is a Python-based framework for building applications whose functionalities can be extended by adding "plug-ins".
http://docs.enthought.com/envisage/
Other
81 stars 26 forks source link

Add Python 3.11 compatibility #511

Closed mdickinson closed 1 year ago

mdickinson commented 1 year ago

The upcoming 7.0 release would be a good time to make sure that the Envisage codebase has no compatibility issues with Python 3.11.

Currently known blockers:

mdickinson commented 1 year ago

Working locally on macOS, I can run the test suite successfully on Python 3.11 if I have no GUI backend installed; that ends up skipping 5 tests. That's better than nothing, so we should probably update the workflow to run on Python 3.11 but without PySide6 installed.

mdickinson commented 1 year ago

And if I do install the most recent version of PySide6, I run into the known issue (enthought/pyface#1163):

  File "/Users/mdickinson/.venvs/envisage/lib/python3.11/site-packages/pyface/ui/qt4/tasks/main_window_layout.py", line 29, in <module>
    from .dock_pane import AREA_MAP
  File "/Users/mdickinson/.venvs/envisage/lib/python3.11/site-packages/pyface/ui/qt4/tasks/dock_pane.py", line 31, in <module>
    INVERSE_AREA_MAP = dict((int(v), k) for k, v in AREA_MAP.items())
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mdickinson/.venvs/envisage/lib/python3.11/site-packages/pyface/ui/qt4/tasks/dock_pane.py", line 31, in <genexpr>
    INVERSE_AREA_MAP = dict((int(v), k) for k, v in AREA_MAP.items())
                             ^^^^^^
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'DockWidgetArea'
mdickinson commented 1 year ago

That's better than nothing, so we should probably update the workflow to run on Python 3.11 but without PySide6 installed.

Done in #513.