From bf7b5fcd7f2620c371b3c74994927069a0dccdde Mon Sep 17 00:00:00 2001
From: Ryan Clary <9618975+mrclary@users.noreply.github.com>
Date: Thu, 28 Sep 2023 23:01:24 -0700
Subject: [PATCH] Use conda-forge channeldata.json instead of conda search.
---
spyder/workers/updates.py | 23 ++++++-----------------
1 file changed, 6 insertions(+), 17 deletions(-)
diff --git a/spyder/workers/updates.py b/spyder/workers/updates.py
index c7c69a76948..1eeb469196f 100644
--- a/spyder/workers/updates.py
+++ b/spyder/workers/updates.py
@@ -95,27 +95,16 @@ def get_releases(self):
if self.update_from_github:
# Get releases from GitHub
url = 'https://api.github.com/repos/spyder-ide/spyder/releases'
- logger.debug(f"Getting releases from {url}.")
- data = urlopen(url, **context).read()
else:
- # Get releases from conda
- logger.debug("Getting releases from conda-forge.")
- if os.name == "nt":
- platform = "win-64"
- elif sys.platform == "darwin":
- platform = "osx-64"
- else:
- platform = "linux-64"
- cmd = f"{find_conda()} search "
- cmd += f"'spyder[channel=conda-forge, subdir={platform}]'"
- cmd += " --json"
- proc = run_shell_command(cmd)
- data, err = proc.communicate(timeout=20)
+ # Get releases from conda-forge
+ url = 'https://conda.anaconda.org/conda-forge/channeldata.json'
+ logger.debug(f"Getting releases from {url}.")
+ data = urlopen(url, **context).read()
except URLError as exc:
logger.debug(exc)
self.error = _('Unable to connect to the internet.
Make '
'sure the connection is working properly.')
- except (HTTPError, TimeoutError, Exception) as exc:
+ except (HTTPError, Exception) as exc:
logger.debug(exc)
self.error = _('Unable to retrieve Spyder version information.')
@@ -132,7 +121,7 @@ def get_releases(self):
releases = set(item['tag_name'].replace('v', '')
for item in data)
else:
- releases = set(v['version'] for v in data['spyder'])
+ releases = [data['packages']['spyder']['version']]
# Always reset self.releases
self.releases = sorted(releases)