From 71f8ec30021e1f256e07338286c16aad2f4a9573 Mon Sep 17 00:00:00 2001 From: dalthviz <16781833+dalthviz@users.noreply.github.com> Date: Wed, 6 Mar 2024 15:08:24 -0500 Subject: [PATCH 1/5] Release 5.5.2rc1 [ci skip] --- spyder/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spyder/__init__.py b/spyder/__init__.py index bc22fe483ba..61229ca6179 100644 --- a/spyder/__init__.py +++ b/spyder/__init__.py @@ -29,7 +29,7 @@ OTHER DEALINGS IN THE SOFTWARE. """ -version_info = (5, 5, "2rc0") +version_info = (5, 5, "2rc1") __version__ = '.'.join(map(str, version_info)) __installer_version__ = __version__ From 8a5ceeb4b9a8c5ee42feefe623da85ee16e316ec Mon Sep 17 00:00:00 2001 From: Carlos Cordoba Date: Fri, 8 Mar 2024 20:53:06 -0500 Subject: [PATCH 2/5] Application: Fix showing update status bar widget in our apps at startup --- spyder/plugins/application/container.py | 7 +------ spyder/plugins/application/plugin.py | 5 +++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/spyder/plugins/application/container.py b/spyder/plugins/application/container.py index 1b1039ef4dd..8d169e05da4 100644 --- a/spyder/plugins/application/container.py +++ b/spyder/plugins/application/container.py @@ -111,16 +111,11 @@ def setup(self): parent=self ) - # Users can only use this widget in our apps. - if not is_pynsist() and not running_in_mac_app(): - self.application_update_status.hide() - else: - self.application_update_status.set_no_status() - (self.application_update_status.sig_check_for_updates_requested .connect(self.check_updates)) (self.application_update_status.sig_install_on_close_requested .connect(self.set_installer_path)) + self.application_update_status.set_no_status() self.give_updates_feedback = False self.thread_updates = None diff --git a/spyder/plugins/application/plugin.py b/spyder/plugins/application/plugin.py index 7c2841d98ae..7bbbcfbe1bc 100644 --- a/spyder/plugins/application/plugin.py +++ b/spyder/plugins/application/plugin.py @@ -25,6 +25,7 @@ on_plugin_available, on_plugin_teardown) from spyder.api.widgets.menus import MENU_SEPARATOR from spyder.config.base import (DEV, get_module_path, get_debug_level, + is_pynsist, running_in_mac_app, running_under_pytest) from spyder.plugins.application.confpage import ApplicationConfigPage from spyder.plugins.application.container import ( @@ -147,9 +148,9 @@ def on_mainwindow_visible(self): container.give_updates_feedback = False container.check_updates(startup=True) - # Hide status bar widget for updates if it doesn't need to be visible. + # Users only need to see this widget in our apps. # Note: This can only be done at this point to take effect. - if not self.application_update_status.isVisible(): + if not (is_pynsist() or running_in_mac_app()): self.application_update_status.setVisible(False) # Handle DPI scale and window changes to show a restart message. From ff5a8465c3ad30ee63ec11f1d2280810d0a61b28 Mon Sep 17 00:00:00 2001 From: Carlos Cordoba Date: Sat, 9 Mar 2024 10:39:32 -0500 Subject: [PATCH 3/5] Updates: Report Spyder updates even if an error occurs at startup Otherwise the "Check for updates" action in the Help menu would always appear as disabled to users. --- spyder/workers/updates.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/spyder/workers/updates.py b/spyder/workers/updates.py index 00de01db3b2..435f8c279f6 100644 --- a/spyder/workers/updates.py +++ b/spyder/workers/updates.py @@ -177,13 +177,14 @@ def start(self): ).format(formatted_error) logger.debug(err, stack_info=True) - # Don't show dialog when starting up spyder and an error occur - if not (self.startup and error_msg is not None): - self.error = error_msg - try: - self.sig_ready.emit() - except RuntimeError: - pass + # At this point we **must** emit the signal below so that the "Check + # for updates" action in the Help menu is enabled again after the check + # has finished (it's disabled while the check is running). + self.error = error_msg + try: + self.sig_ready.emit() + except RuntimeError: + pass class WorkerDownloadInstaller(QObject): @@ -336,6 +337,7 @@ def start(self): '{}' ).format(formatted_error) logger.debug(err, stack_info=True) + self.error = error_msg try: self.sig_ready.emit(self.installer_path) From fe733cf9c66eca2f1da38116d599f1aa4b3b3dd3 Mon Sep 17 00:00:00 2001 From: Carlos Cordoba Date: Sat, 9 Mar 2024 10:42:44 -0500 Subject: [PATCH 4/5] Updates: Only log generic errors when checking for updates That's because we're unable to give proper feedback to users about what to do to solve the error. --- spyder/workers/updates.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/spyder/workers/updates.py b/spyder/workers/updates.py index 435f8c279f6..db958f1ba40 100644 --- a/spyder/workers/updates.py +++ b/spyder/workers/updates.py @@ -166,15 +166,10 @@ def start(self): error_msg = HTTP_ERROR_MSG.format(status_code=page.status_code) logger.debug(err, stack_info=True) except Exception as err: - error = traceback.format_exc() - formatted_error = error.replace('\n', '
').replace(' ', ' ') - - error_msg = _( - 'It was not possible to check for Spyder updates due to the ' - 'following error:' - '

' - '{}' - ).format(formatted_error) + # Only log the error when it's a generic one because we can't give + # users proper feedback on how to address it. Otherwise we'd show + # a long traceback that most probably would be incomprehensible to + # them. logger.debug(err, stack_info=True) # At this point we **must** emit the signal below so that the "Check From df7f128f659ba7e82bb50355c3301a2a2db5b85f Mon Sep 17 00:00:00 2001 From: Carlos Cordoba Date: Tue, 12 Mar 2024 16:59:07 -0500 Subject: [PATCH 5/5] Application: Fix showing messages on update status widget for installers --- spyder/plugins/application/container.py | 22 +++++++++++++--------- spyder/plugins/application/plugin.py | 3 +-- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/spyder/plugins/application/container.py b/spyder/plugins/application/container.py index 8d169e05da4..ae7fcaf1486 100644 --- a/spyder/plugins/application/container.py +++ b/spyder/plugins/application/container.py @@ -111,11 +111,13 @@ def setup(self): parent=self ) + if self.is_installer(): + self.application_update_status.set_no_status() + (self.application_update_status.sig_check_for_updates_requested .connect(self.check_updates)) (self.application_update_status.sig_install_on_close_requested .connect(self.set_installer_path)) - self.application_update_status.set_no_status() self.give_updates_feedback = False self.thread_updates = None @@ -292,10 +294,10 @@ def _check_updates_ready(self): box.setText(error_msg) box.set_check_visible(False) box.show() - if self.application_update_status.isVisible(): + if self.is_installer(): self.application_update_status.set_no_status() elif update_available: - if self.application_update_status.isVisible(): + if self.is_installer(): self.application_update_status.set_status_pending( latest_release) @@ -307,7 +309,7 @@ def _check_updates_ready(self): box.setStandardButtons(QMessageBox.Yes | QMessageBox.No) box.setDefaultButton(QMessageBox.Yes) - if not is_pynsist() and not running_in_mac_app(): + if not self.is_installer(): installers_url = url_i + "#standalone-installers" msg = ( header + @@ -337,8 +339,7 @@ def _check_updates_ready(self): not box.result() # The installer dialog was skipped or ( box.result() == QMessageBox.No - and not is_pynsist() - and not running_in_mac_app() + and not self.is_installer() ) ): # Update-at-startup checkbox visible only if manual update @@ -421,10 +422,10 @@ def _check_updates_ready(self): elif feedback: box.setText(_("Spyder is up to date.")) box.show() - if self.application_update_status.isVisible(): + if self.is_installer(): self.application_update_status.set_no_status() else: - if self.application_update_status.isVisible(): + if self.is_installer(): self.application_update_status.set_no_status() self.set_conf(option, box.is_checked()) @@ -445,7 +446,7 @@ def check_updates(self, startup=False): self.check_updates_action.setDisabled(True) self.check_updates_action.setText(_("Checking for updates...")) - if self.application_update_status.isVisible(): + if self.is_installer(): self.application_update_status.set_status_checking() if self.thread_updates is not None: @@ -476,6 +477,9 @@ def set_installer_path(self, installer_path): """Set installer executable path to be run when closing.""" self.installer_path = installer_path + def is_installer(self): + return is_pynsist() or running_in_mac_app() + # ---- Dependencies # ------------------------------------------------------------------------- @Slot() diff --git a/spyder/plugins/application/plugin.py b/spyder/plugins/application/plugin.py index 7bbbcfbe1bc..015e70770ba 100644 --- a/spyder/plugins/application/plugin.py +++ b/spyder/plugins/application/plugin.py @@ -25,7 +25,6 @@ on_plugin_available, on_plugin_teardown) from spyder.api.widgets.menus import MENU_SEPARATOR from spyder.config.base import (DEV, get_module_path, get_debug_level, - is_pynsist, running_in_mac_app, running_under_pytest) from spyder.plugins.application.confpage import ApplicationConfigPage from spyder.plugins.application.container import ( @@ -150,7 +149,7 @@ def on_mainwindow_visible(self): # Users only need to see this widget in our apps. # Note: This can only be done at this point to take effect. - if not (is_pynsist() or running_in_mac_app()): + if not container.is_installer(): self.application_update_status.setVisible(False) # Handle DPI scale and window changes to show a restart message.