Skip to content

Commit

Permalink
Set WorkerUpdate.channel to pypi if Spyder is not installed by conda.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrclary committed Oct 14, 2024
1 parent d233a6e commit 9433dbe
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion spyder/plugins/updatemanager/widgets/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ def manual_update_messagebox(parent, latest_release, channel):
).format(dont_mix_pip_conda_video)
else:
if channel == 'pkgs/main':
channel = ''
channel = '-c defaults'
else:
channel = f'-c {channel}'

Expand Down
16 changes: 10 additions & 6 deletions spyder/plugins/updatemanager/workers.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ def __init__(self, stable_only):
self.releases = None
self.update_available = False
self.error = None
self.channel = None

def _check_update_available(self):
"""Checks if there is an update available from releases."""
Expand Down Expand Up @@ -200,12 +201,15 @@ def start(self):
error_msg = None
url = 'https://api.github.com/repos/spyder-ide/spyder/releases'

# If Spyder is installed from defaults channel (pkgs/main), then use
# that channel to get updates. The defaults channel can be far behind
# our latest release
if is_anaconda():
channel, channel_url = get_spyder_conda_channel()
if channel == "pkgs/main":
if not is_conda_based_app():
self.channel = "pypi" # Default channel if not conda
if is_anaconda():
self.channel, channel_url = get_spyder_conda_channel()

# If Spyder is installed from defaults channel (pkgs/main), then
# use that channel to get updates. The defaults channel can be far
# behind our latest release.
if self.channel == "pkgs/main":
url = channel_url + '/channeldata.json'

headers = {}
Expand Down

0 comments on commit 9433dbe

Please sign in to comment.