PR: Use spyder-updater to handle updates (Installers)#24144
PR: Use spyder-updater to handle updates (Installers)#24144ccordoba12 merged 12 commits intospyder-ide:masterfrom
spyder-updater to handle updates (Installers)#24144Conversation
spyder-updater to handle updates (Installers)
ccordoba12
left a comment
There was a problem hiding this comment.
Great work here, thanks @mrclary!
ccordoba12
left a comment
There was a problem hiding this comment.
A few more suggestions for you @mrclary.
What if we create the |
I agree that we should do something here. I'd prefer to leave it for a another PR, and possibly another alpha or beta release, if that's okay. One issue is that anytime the updater requires updating, it may take this long, even if it is already installed. The updater will need to be checked and updated prior to updating Sypder, so this could happen even after it is first installed on first launch of 6.1+. In addition to your proposal, I'd like to consider adding a message window with progress bar informing the user that Spyder-updater is updating, similar to our download. |
5b931d4 to
08d8f29
Compare
|
Gave this a check on Windows using the latest commit where version 6.0.5 is set and an error was raised: Traceback (most recent call last):
File "E:\Acer\Documentos\Spyder\Spyder otros\mrclary\spyder\spyder\plugins\updatemanager\workers.py", line 609, in start
self._install_update()
File "E:\Acer\Documentos\Spyder\Spyder otros\mrclary\spyder\spyder\plugins\updatemanager\workers.py", line 599, in _install_update
proc.check_returncode()
File "C:\Users\dalth\AppData\Local\spyder-6\envs\spyder-runtime\Lib\subprocess.py", line 502, in check_returncode
raise CalledProcessError(self.returncode, self.args, self.stdout,
subprocess.CalledProcessError: Command 'C:/Users/dalth/AppData/Local/spyder-6\Scripts\conda.exe create --yes --prefix C:\Users\dalth\AppData\Local\spyder-6\envs\spyder-updater --file C:\Users\dalth\AppData\Local\Temp\spyder\updates\spyder-updater\0.1.0\conda-updater-linux-64.lock && C:/Users/dalth/AppData/Local/spyder-6\Scripts\conda.exe install --yes --prefix C:\Users\dalth\AppData\Local\spyder-6\envs\spyder-updater --no-deps --force-reinstall C:\Users\dalth\AppData\Local\Temp\spyder\updates\spyder-updater\0.1.0\spyder-updater*.conda' returned non-zero exit status 1.
Command 'C:/Users/dalth/AppData/Local/spyder-6\Scripts\conda.exe create --yes --prefix C:\Users\dalth\AppData\Local\spyder-6\envs\spyder-updater --file C:\Users\dalth\AppData\Local\Temp\spyder\updates\spyder-updater\0.1.0\conda-updater-linux-64.lock && C:/Users/dalth/AppData/Local/spyder-6\Scripts\conda.exe install --yes --prefix C:\Users\dalth\AppData\Local\spyder-6\envs\spyder-updater --no-deps --force-reinstall C:\Users\dalth\AppData\Local\Temp\spyder\updates\spyder-updater\0.1.0\spyder-updater*.conda' returned non-zero exit status 1.
Traceback (most recent call last):
File "E:\Acer\Documentos\Spyder\Spyder otros\mrclary\spyder\spyder\plugins\updatemanager\workers.py", line 609, in start
self._install_update()
File "E:\Acer\Documentos\Spyder\Spyder otros\mrclary\spyder\spyder\plugins\updatemanager\workers.py", line 599, in _install_update
proc.check_returncode()
File "C:\Users\dalth\AppData\Local\spyder-6\envs\spyder-runtime\Lib\subprocess.py", line 502, in check_returncode
raise CalledProcessError(self.returncode, self.args, self.stdout,
subprocess.CalledProcessError: Command 'C:/Users/dalth/AppData/Local/spyder-6\Scripts\conda.exe create --yes --prefix C:\Users\dalth\AppData\Local\spyder-6\envs\spyder-updater --file C:\Users\dalth\AppData\Local\Temp\spyder\updates\spyder-updater\0.1.0\conda-updater-linux-64.lock && C:/Users/dalth/AppData/Local/spyder-6\Scripts\conda.exe install --yes --prefix C:\Users\dalth\AppData\Local\spyder-6\envs\spyder-updater --no-deps --force-reinstall C:\Users\dalth\AppData\Local\Temp\spyder\updates\spyder-updater\0.1.0\spyder-updater*.conda' returned non-zero exit status 1.I think the required files were downloaded: But seems like the defined command tries to use the linux conda-lock file even when I'm on Windows? 🤔 Also, when checking the related traceback, I noticed that there is some code with errors at spyder/spyder/plugins/updatemanager/workers.py Lines 601 to 628 in 270860d Not totally sure but seems to me like Edit: Left a couple of comments after checking the code in places from where maybe the experienced error is being caused |
4c45b08 to
989e961
Compare
|
@dalthviz, please give another try to this one to see if the problems you encountered are fixed now. |
|
Checked again and the process still triggers an error: Traceback (most recent call last):
File "E:\Acer\Documentos\Spyder\Spyder otros\mrclary\spyder\spyder\plugins\updatemanager\workers.py", line 612, in start
self._install_update()
File "E:\Acer\Documentos\Spyder\Spyder otros\mrclary\spyder\spyder\plugins\updatemanager\workers.py", line 599, in _install_update
proc.check_returncode()
File "C:\Users\dalth\AppData\Local\spyder-6\envs\spyder-runtime\Lib\subprocess.py", line 502, in check_returncode
raise CalledProcessError(self.returncode, self.args, self.stdout,
subprocess.CalledProcessError: Command 'C:/Users/dalth/AppData/Local/spyder-6\Scripts\conda.exe create --yes --prefix C:\Users\dalth\AppData\Local\spyder-6\envs\spyder-updater --file C:\Users\dalth\AppData\Local\Temp\spyder\updates\spyder-updater\0.1.0\conda-updater-win-64.lock && C:/Users/dalth/AppData/Local/spyder-6\Scripts\conda.exe install --yes --prefix C:\Users\dalth\AppData\Local\spyder-6\envs\spyder-updater --no-deps --force-reinstall C:\Users\dalth\AppData\Local\Temp\spyder\updates\spyder-updater\0.1.0\spyder-updater*.conda' returned non-zero exit status 1.
Command 'C:/Users/dalth/AppData/Local/spyder-6\Scripts\conda.exe create --yes --prefix C:\Users\dalth\AppData\Local\spyder-6\envs\spyder-updater --file C:\Users\dalth\AppData\Local\Temp\spyder\updates\spyder-updater\0.1.0\conda-updater-win-64.lock && C:/Users/dalth/AppData/Local/spyder-6\Scripts\conda.exe install --yes --prefix C:\Users\dalth\AppData\Local\spyder-6\envs\spyder-updater --no-deps --force-reinstall C:\Users\dalth\AppData\Local\Temp\spyder\updates\spyder-updater\0.1.0\spyder-updater*.conda' returned non-zero exit status 1.
Traceback (most recent call last):
File "E:\Acer\Documentos\Spyder\Spyder otros\mrclary\spyder\spyder\plugins\updatemanager\workers.py", line 612, in start
self._install_update()
File "E:\Acer\Documentos\Spyder\Spyder otros\mrclary\spyder\spyder\plugins\updatemanager\workers.py", line 599, in _install_update
proc.check_returncode()
File "C:\Users\dalth\AppData\Local\spyder-6\envs\spyder-runtime\Lib\subprocess.py", line 502, in check_returncode
raise CalledProcessError(self.returncode, self.args, self.stdout,
subprocess.CalledProcessError: Command 'C:/Users/dalth/AppData/Local/spyder-6\Scripts\conda.exe create --yes --prefix C:\Users\dalth\AppData\Local\spyder-6\envs\spyder-updater --file C:\Users\dalth\AppData\Local\Temp\spyder\updates\spyder-updater\0.1.0\conda-updater-win-64.lock && C:/Users/dalth/AppData/Local/spyder-6\Scripts\conda.exe install --yes --prefix C:\Users\dalth\AppData\Local\spyder-6\envs\spyder-updater --no-deps --force-reinstall C:\Users\dalth\AppData\Local\Temp\spyder\updates\spyder-updater\0.1.0\spyder-updater*.conda' returned non-zero exit status 1.However, I think the correct lock file is being used. Trying to manually run the command that the traceback shows I see that it is failing due to a Maybe on Windows the actual name of the file should be used? So something like |
|
@dalthviz, thanks for testing that. Perhaps you are correct and Windows won't glob the file name. I'll see what I can do about that. But just to confirm, the conda file is there, correct? And the spyder-updater environment was created? |
Yep, the conda file is there and indeed the env was created 👍 |
|
Gave this another check with the latest changes and seems like now after After that, I'm unable to open Spyder 🤔 Will try to reinstall and run Spyder on debug mode before doing the update to see if I get any relevant traceback |
|
Thanks @dalthviz, I'll take a look as well. |
|
@dalthviz, @ccordoba12. I think I found the issue; the subprocess command to run the update script should be "cmd" instead of "start". I created a pull request for this fix spyder-ide/spyder-updater#3. I also updated the test release on my fork to contain this change. Delete the spyder-6/envs/spyder-updater environment and try the update through Spyder again. This should create the spyder-updater environment using the new release and work as expected 🤞🏼 |
|
I tried again removing the |
|
Gave another check with the latest changes and indeed seems like the minor updates are working 🎉 Also, although a major update is not being handled via the updater, I gave it a try. Seems like no new updater related logic is triggered (which I think is expected) but it seems like the process is failing (maybe the logic currently implemented expects to work as if the previous installed version is Spyder 5?): Is there already an issue for that or could it be worthy to open an issue? Or maybe is failing for me since some other setup is needed to be able to properly trigger that kind of update? 🤔 Kind of out of the scope of this PR but probably something that needs to be addressed in the future so sharing the finding. |
…wnloading. User will be notified of spyder update. If user responds affirmatively to download the update, then spyder-updater is first checked and updated, then proceeds to download.
* Send all Exceptions to Spyder's error reporter. User is already alerted to a Spyder update, so any exceptions here cannot be quietly bypassed. * Raise CompletedProcessError if the updater environment does not exist and there is no update available for the updater
Co-authored-by: Carlos Cordoba <ccordoba12@gmail.com>
Co-authored-by: Daniel Althviz Moré <16781833+dalthviz@users.noreply.github.com>
|
I retested on macOS and everything looks good. When the workflows are done, this should be ready for merge. |





Use
spyder-updaterfor minor/micro updates to Spyder's conda-based installer.All update procedures and user interaction remains unchanged for all scenarios except minor/micro updates to Spyder's conda-based installer. All major updates are still handled by Spyder, as well as all downloads. Minor/micro updates are only allowed for the conda-based installer, as before, but now
spyder-updateris launched to provide the graphical user interface for the conda environment updates.For minor/micro updates to Spyder:
spyder-updater. Upon successful completion (or if nospyder-updaterupdates are available), then Spyder will proceed to download the Spyder lock files.spyder-updater.Testing with Spyder Updater
To test integration with Spyder Updater, do the following.
spyder-updater-testbranch from mrclary/spyder fork in your local Spyder repository.spyder-updaterbranch contains these changes (to be reverted before merging). You can modify the version number as desired for testing.If checking for major update:
spyder-<user>/updates/6.1.0a1in a temporary location.If checking for minor/micro update:
spyder-<user>/updates/spyder-updater/0.1.0in a temporary location. You should see a conda package and conda lock files.spyder-updaterenvironment to be installed alongside thespyder-runtimeenvironment.Return to step 3 to test different scenarios.