Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR: Create UpdateManager plugin to handle updates for the conda-based installers #21483

Merged
merged 22 commits into from
Dec 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
0732948
Remove application update mechanism from Application plugin and move …
mrclary Dec 11, 2023
e45b826
Rename plugin files
mrclary Dec 11, 2023
27f463b
Initial commit for Update Manager Plugin
mrclary Oct 31, 2023
4f25a57
Do not check for updates on startup if development version
mrclary Nov 14, 2023
e10fea1
Fix issue where versions were not sorted in release order
mrclary Nov 14, 2023
55f7960
Set latest_release, installer_path, and compute major_release in star…
mrclary Nov 14, 2023
8dfe4fa
Fix typo that prevented checking for updates at startup.
mrclary Nov 16, 2023
08a8594
Use warning instead of exception or error logging level. exception an…
mrclary Nov 16, 2023
d2b875a
Fix issue where download size verification was not int type
mrclary Nov 17, 2023
b9958f1
Fix KeyError when applying string format
mrclary Nov 26, 2023
5bb28e3
Do not check for custom_widget after initialization.
mrclary Nov 28, 2023
28ff22f
Use cb suffix for checkbox object names
mrclary Nov 28, 2023
dd7376f
Set status to NO_STATUS upon applying change to check_stable_only
mrclary Nov 28, 2023
623e67d
Bump major version of configuration because an option is removed from…
mrclary Nov 29, 2023
3f89181
Apply suggestion from code review.
mrclary Nov 29, 2023
4c14e30
Apply suggestions from code review
mrclary Dec 12, 2023
7b6b1a9
Restore check for update preference to Application preference pane
mrclary Dec 13, 2023
38f861e
Use GITHUB_TOKEN with test steps in testing workflows to avoid error:…
mrclary Dec 14, 2023
a5300be
Add UpdateManager to Application.OPTIONAL attribute
mrclary Dec 15, 2023
2e27a02
Fix issue where 'check_stable_only' was incorrectly compared to self.…
mrclary Dec 15, 2023
f5ca4a0
Display CLI notice when updating or installing, not just when updating.
mrclary Dec 15, 2023
2d9d5de
Fix issue in installer batch script where echo reported echo state ra…
mrclary Dec 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/test-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,13 @@ jobs:
- name: Run tests with gdb
if: env.USE_GDB == 'true'
shell: bash -l {0}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: xvfb-run --auto-servernum gdb -return-child-result -batch -ex r -ex py-bt --args python runtests.py -s
- name: Run tests
shell: bash -l {0}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
rm -f pytest_log.txt # Must remove any log file from a previous run
.github/scripts/run_tests.sh || \
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ jobs:
run: check-manifest
- name: Run tests
shell: bash -l {0}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
rm -f pytest_log.txt # Must remove any log file from a previous run
.github/scripts/run_tests.sh || \
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ jobs:
run: check-manifest
- name: Run tests
shell: bash -l {0}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
rm -f pytest_log.txt # Must remove any log file from a previous run
.github/scripts/run_tests.sh || \
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ def run(self):
'switcher = spyder.plugins.switcher.plugin:Switcher',
'toolbar = spyder.plugins.toolbar.plugin:Toolbar',
'tours = spyder.plugins.tours.plugin:Tours',
'update_manager = spyder.plugins.updatemanager.plugin:UpdateManager',
'variable_explorer = spyder.plugins.variableexplorer.plugin:VariableExplorer',
'workingdir = spyder.plugins.workingdirectory.plugin:WorkingDirectory',
]
Expand Down
1 change: 1 addition & 0 deletions spyder/api/plugins/enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class Plugins:
Switcher = 'switcher'
Toolbar = "toolbar"
Tours = 'tours'
UpdateManager = 'update_manager'
VariableExplorer = 'variable_explorer'
WorkingDirectory = 'workingdir'

Expand Down
8 changes: 6 additions & 2 deletions spyder/config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,16 @@
'custom_margin': 0,
'use_custom_cursor_blinking': False,
'show_internal_errors': True,
'check_updates_on_startup': True,
'cursor/width': 2,
'completion/size': (300, 180),
'report_error/remember_token': False,
'show_dpi_message': True,
}),
('update_manager',
{
'check_updates_on_startup': True,
'check_stable_only': True,
}),
mrclary marked this conversation as resolved.
Show resolved Hide resolved
('toolbar',
{
'enable': True,
Expand Down Expand Up @@ -663,4 +667,4 @@
# or if you want to *rename* options, then you need to do a MAJOR update in
# version, e.g. from 3.0.0 to 4.0.0
# 3. You don't need to touch this value if you're just adding a new option
CONF_VERSION = '81.0.0'
CONF_VERSION = '82.0.0'
24 changes: 21 additions & 3 deletions spyder/plugins/application/confpage.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

from spyder.config.base import (_, DISABLED_LANGUAGES, LANGUAGE_CODES,
is_conda_based_app, save_lang_conf)
from spyder.api.plugins import Plugins
from spyder.api.preferences import PluginConfigPage
from spyder.py3compat import to_text_string

Expand Down Expand Up @@ -65,8 +66,16 @@ def setup_page(self):
prompt_box = newcb(_("Prompt when exiting"), 'prompt_on_exit')
popup_console_box = newcb(_("Show internal Spyder errors to report "
"them to Github"), 'show_internal_errors')
check_updates = newcb(_("Check for updates on startup"),
'check_updates_on_startup')
check_update_cb = newcb(
_("Check for updates on startup"),
'check_updates_on_startup',
section='update_manager'
)
stable_only_cb = newcb(
_("Check for stable releases only"),
'check_stable_only',
section='update_manager'
)

# Decide if it's possible to activate or not single instance mode
# ??? Should we allow multiple instances for macOS?
Expand All @@ -88,7 +97,8 @@ def setup_page(self):
advanced_layout.addWidget(single_instance_box)
advanced_layout.addWidget(prompt_box)
advanced_layout.addWidget(popup_console_box)
advanced_layout.addWidget(check_updates)
advanced_layout.addWidget(check_update_cb)
advanced_layout.addWidget(stable_only_cb)

advanced_widget = QWidget()
advanced_widget.setLayout(advanced_layout)
Expand Down Expand Up @@ -272,6 +282,14 @@ def apply_settings(self, options):
self.set_option(
'high_dpi_custom_scale_factors', scale_factors_text)
self.changed_options.add('high_dpi_custom_scale_factors')

um = self.plugin.get_plugin(Plugins.UpdateManager, error=False)
if (
um
and ('update_manager', 'check_stable_only') in self.changed_options
):
um.update_manager_status.set_no_status()

self.plugin.apply_settings()

def _save_lang(self):
Expand Down
Loading