From d5a9e4eef56286dd44ba14838fd68a4a8da6edfc Mon Sep 17 00:00:00 2001 From: Jitse Niesen Date: Tue, 7 Nov 2023 11:47:04 +0000 Subject: [PATCH 1/4] Update to plugin API from Spyder 6.0.0a2 Specifically, make `UnitTestPlugin.get_description()` a static method and `UnitTestPlugin.get_icon()` a class method. --- spyder_unittest/unittestplugin.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spyder_unittest/unittestplugin.py b/spyder_unittest/unittestplugin.py index 236dce3..fdc0abc 100644 --- a/spyder_unittest/unittestplugin.py +++ b/spyder_unittest/unittestplugin.py @@ -72,7 +72,8 @@ def get_name(): """ return _('Unit testing') - def get_description(self): + @staticmethod + def get_description(): """ Return the plugin localized description. @@ -83,7 +84,8 @@ def get_description(self): """ return _('Run test suites and view their results') - def get_icon(self): + @classmethod + def get_icon(cls): """ Return the plugin associated icon. From cc0128416a73084b04b06a059dbd6314564d8173 Mon Sep 17 00:00:00 2001 From: Jitse Niesen Date: Tue, 7 Nov 2023 12:28:47 +0000 Subject: [PATCH 2/4] Update config page test to new API * Return value of `.create_checkbox()` changed in spyder-ide/spyder#20926 (Show tooltips in Preferences). * Handling of Prefs dialog box size changed in spyder-ide/spyder#21233 (Improve style of Preferences dialog box). --- spyder_unittest/widgets/confpage.py | 3 ++- spyder_unittest/widgets/tests/test_confpage.py | 10 +--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/spyder_unittest/widgets/confpage.py b/spyder_unittest/widgets/confpage.py index e924b14..b46473b 100644 --- a/spyder_unittest/widgets/confpage.py +++ b/spyder_unittest/widgets/confpage.py @@ -24,8 +24,9 @@ class UnitTestConfigPage(PluginConfigPage): def setup_page(self) -> None: settings_group = QGroupBox(_('Settings')) - self.abbrev_box = self.create_checkbox( + widget = self.create_checkbox( _('Abbreviate test names'), 'abbrev_test_names', default=False) + self.abbrev_box = widget.checkbox settings_layout = QVBoxLayout() settings_layout.addWidget(self.abbrev_box) diff --git a/spyder_unittest/widgets/tests/test_confpage.py b/spyder_unittest/widgets/tests/test_confpage.py index 5ea6bdc..6790a18 100644 --- a/spyder_unittest/widgets/tests/test_confpage.py +++ b/spyder_unittest/widgets/tests/test_confpage.py @@ -71,9 +71,6 @@ def get_plugin(self, plugin_name, error=True): if plugin_name in PLUGIN_REGISTRY: return PLUGIN_REGISTRY.get_plugin(plugin_name) - def set_prefs_size(self, size): - pass - class ConfigDialogTester(QWidget): def __init__(self, parent, main_class, @@ -83,9 +80,6 @@ def __init__(self, parent, main_class, if self._main is None: self._main = MainWindowMock(self) - def set_prefs_size(self, size): - pass - def register_plugin(self, plugin_name, external=False): plugin = PLUGIN_REGISTRY.get_plugin(plugin_name) plugin._register() @@ -101,8 +95,6 @@ def get_plugin(self, plugin_name, error=True): # types.MethodType(register_plugin, self._main)) setattr(self._main, 'get_plugin', types.MethodType(get_plugin, self._main)) - setattr(self._main, 'set_prefs_size', - types.MethodType(set_prefs_size, self._main)) PLUGIN_REGISTRY.reset() PLUGIN_REGISTRY.sig_plugin_ready.connect(self._main.register_plugin) @@ -135,7 +127,7 @@ def config_dialog(qtbot, request): qtbot.addWidget(main_ref) preferences = main_ref._main.get_plugin(Plugins.Preferences) - preferences.open_dialog(None) + preferences.open_dialog() container = preferences.get_container() dlg = container.dialog From 2e7deb807593d470f12939716f9f1f6d08fd11cf Mon Sep 17 00:00:00 2001 From: Jitse Niesen Date: Tue, 7 Nov 2023 12:42:23 +0000 Subject: [PATCH 3/4] Test against Python 3.9-3.11 in GitHub automatic tests We used to test against Python 3.8-3.10, but conda-forge is dropping support for Python 3.8. --- .github/workflows/run-tests.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 46e8490..a8a2427 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -14,20 +14,21 @@ jobs: fail-fast: false matrix: OS: ['ubuntu', 'macos', 'windows'] - PYTHON_VERSION: ['3.8', '3.9', '3.10'] + PYTHON_VERSION: ['3.9', '3.10', '3.11'] SPYDER_SOURCE: ['conda', 'git'] exclude: + # Remove some configurations to make CI tests run faster - OS: 'macos' - PYTHON_VERSION: '3.8' + PYTHON_VERSION: '3.9' SPYDER_SOURCE: 'git' - OS: 'macos' - PYTHON_VERSION: '3.9' + PYTHON_VERSION: '3.10' SPYDER_SOURCE: 'git' - OS: 'windows' - PYTHON_VERSION: '3.8' + PYTHON_VERSION: '3.9' SPYDER_SOURCE: 'git' - OS: 'windows' - PYTHON_VERSION: '3.9' + PYTHON_VERSION: '3.10' SPYDER_SOURCE: 'git' name: ${{ matrix.OS }} py${{ matrix.PYTHON_VERSION }} spyder-from-${{ matrix.SPYDER_SOURCE }} runs-on: ${{ matrix.OS }}-latest From b4038ffc3ab4dac207bc380b5544899fd7c8fb43 Mon Sep 17 00:00:00 2001 From: Jitse Niesen Date: Tue, 7 Nov 2023 13:30:59 +0000 Subject: [PATCH 4/4] Do not test against conda in GitHub automatic tests Latest Spyder version on conda-forge is 6.0.0alpha2 at the moment. That is not compatible with Spyder's master branch. --- .github/workflows/run-tests.yml | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index a8a2427..734e1d8 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -15,21 +15,10 @@ jobs: matrix: OS: ['ubuntu', 'macos', 'windows'] PYTHON_VERSION: ['3.9', '3.10', '3.11'] - SPYDER_SOURCE: ['conda', 'git'] - exclude: - # Remove some configurations to make CI tests run faster - - OS: 'macos' - PYTHON_VERSION: '3.9' - SPYDER_SOURCE: 'git' - - OS: 'macos' - PYTHON_VERSION: '3.10' - SPYDER_SOURCE: 'git' - - OS: 'windows' - PYTHON_VERSION: '3.9' - SPYDER_SOURCE: 'git' - - OS: 'windows' - PYTHON_VERSION: '3.10' - SPYDER_SOURCE: 'git' + # Do not test against conda for the moment because latest Spyder + # version on conda-forge is 6.0.0alpha2 which is not compatible + # with Spyder's master branch + SPYDER_SOURCE: ['git'] name: ${{ matrix.OS }} py${{ matrix.PYTHON_VERSION }} spyder-from-${{ matrix.SPYDER_SOURCE }} runs-on: ${{ matrix.OS }}-latest env: