From 4e7a692b980ff5a0d2999fe0801aa80957ead613 Mon Sep 17 00:00:00 2001 From: Eric Prestat Date: Wed, 8 May 2024 16:03:34 +0100 Subject: [PATCH 1/4] Reset testing against hyperspy dev branch --- .github/workflows/tests.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ba59476..81e37f6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -72,19 +72,15 @@ jobs: sudo apt-get install libxcb-render-util0 sudo apt-get install libxcb-xinerama0 - - name: Install HyperSpy (RELEASE_next_major) + - name: Install HyperSpy (RELEASE_next_minor) if: contains( matrix.LABEL, 'RnM') run: | - # pip install git+https://github.com/hyperspy/hyperspy.git@RELEASE_next_major - # revert back when hyperspy 2.1 is released pip install git+https://github.com/hyperspy/hyperspy.git@RELEASE_next_minor - name: Install HyperSpy (RELEASE_next_patch) if: contains( matrix.LABEL, 'RnP') run: | - # pip install git+https://github.com/hyperspy/hyperspy.git@RELEASE_next_patch - # revert back when hyperspy 2.1 is released - pip install git+https://github.com/hyperspy/hyperspy.git@RELEASE_next_minor + pip install git+https://github.com/hyperspy/hyperspy.git@RELEASE_next_patch - name: Install exSpy if: ${{ ! contains( matrix.LABEL, 'minimum') }} From f998e8d27ebd28757b7b4cb1c096921d6aa52b95 Mon Sep 17 00:00:00 2001 From: Eric Prestat Date: Wed, 8 May 2024 16:44:19 +0100 Subject: [PATCH 2/4] Use `qt` instead of `qt4` when setting `ETSConfig.toolkit`. Remove empty `conftest.py` file --- hyperspy_gui_traitsui/__init__.py | 2 +- hyperspy_gui_traitsui/conftest.py | 0 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 hyperspy_gui_traitsui/conftest.py diff --git a/hyperspy_gui_traitsui/__init__.py b/hyperspy_gui_traitsui/__init__.py index 2da2b1a..ded5653 100644 --- a/hyperspy_gui_traitsui/__init__.py +++ b/hyperspy_gui_traitsui/__init__.py @@ -107,7 +107,7 @@ def set_ets_toolkit(toolkit): if "WX" in backend: set_ets_toolkit("wx") elif "Qt" in backend: - set_ets_toolkit("qt4") + set_ets_toolkit("qt") elif ETSConfig.toolkit == "": # The toolkit has not been set and no supported toolkit is available, so # setting it to "null" diff --git a/hyperspy_gui_traitsui/conftest.py b/hyperspy_gui_traitsui/conftest.py deleted file mode 100644 index e69de29..0000000 From 5e0cdfc3349c6934b222f88e12d98404ce01a3da Mon Sep 17 00:00:00 2001 From: Eric Prestat Date: Wed, 8 May 2024 17:01:30 +0100 Subject: [PATCH 3/4] Use lowercase for checking matplotlib backend --- hyperspy_gui_traitsui/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hyperspy_gui_traitsui/__init__.py b/hyperspy_gui_traitsui/__init__.py index ded5653..39b9d87 100644 --- a/hyperspy_gui_traitsui/__init__.py +++ b/hyperspy_gui_traitsui/__init__.py @@ -101,12 +101,12 @@ def set_ets_toolkit(toolkit): # Get the backend from matplotlib -backend = matplotlib.get_backend() +backend = matplotlib.get_backend().lower() _logger.debug('Loading hyperspy.traitsui_gui') _logger.debug('Current MPL backend: %s', backend) -if "WX" in backend: +if "wx" in backend: set_ets_toolkit("wx") -elif "Qt" in backend: +elif "qt" in backend: set_ets_toolkit("qt") elif ETSConfig.toolkit == "": # The toolkit has not been set and no supported toolkit is available, so From 42aa4d71e8a2d47b92f0c7605562ed29d379fc5f Mon Sep 17 00:00:00 2001 From: Eric Prestat Date: Wed, 8 May 2024 18:03:59 +0100 Subject: [PATCH 4/4] Add changelog entry --- CHANGES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index b2e7d3f..8758091 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,8 @@ ## v2.1 (UNRELEASED) +* Fix getting matplotlib backend for matplotlib >= 3.10.dev ([#78](https://github.com/hyperspy/hyperspy_gui_traitsui/pull/78)). +* Use `qt` instead of `qt4` when setting `ETSConfig.toolkit` ([#78](https://github.com/hyperspy/hyperspy_gui_traitsui/pull/78)). * Fix slider in image contrast editor on python >=3.10 ([#76](https://github.com/hyperspy/hyperspy_gui_traitsui/pull/76)). * Fix getting version with editable installation ([#75](https://github.com/hyperspy/hyperspy_gui_traitsui/pull/75)). * Add releasing guide and release script ([#75](https://github.com/hyperspy/hyperspy_gui_traitsui/pull/75)).