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: Update to napari/label/bundle_tools_3 (Installers) #21125

Merged
merged 15 commits into from
Jul 20, 2023

Conversation

mrclary
Copy link
Contributor

@mrclary mrclary commented Jul 12, 2023

This PR updates the cond-based installer tools to the latest napari/label/bundle_tools_3, which include several updates to constructor and menuinst.

Additionally:

  • Added app_user_model_id to shortcut definition for Windows
  • Improved logging of the installation test on CI
  • Fixed issues with sh type installer for macOS
  • Accommodate use of .nonadmin with updated menuinst
  • All-user installation on Linux now adds aliases to the shell startup file for each real user.
  • Uninstall script alias is only added to shell startup file if installing for single user.

@mrclary mrclary self-assigned this Jul 12, 2023
@mrclary mrclary force-pushed the bundle_tools_3 branch 7 times, most recently from 4b2fcb3 to b79daf9 Compare July 14, 2023 19:19
@mrclary mrclary marked this pull request as ready for review July 14, 2023 19:20
@ccordoba12 ccordoba12 changed the title PR: Update to napari/label/bundle_tools_3 PR: Update to napari/label/bundle_tools_3 (Installers) Jul 15, 2023
@ccordoba12 ccordoba12 added this to the v6.0alpha2 milestone Jul 15, 2023
Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of comments for you @mrclary, the rest looks good to me.

.github/workflows/installers-conda.yml Outdated Show resolved Hide resolved
installers-conda/resources/post-install.sh Outdated Show resolved Hide resolved
@mrclary mrclary marked this pull request as draft July 15, 2023 19:58
@mrclary
Copy link
Contributor Author

mrclary commented Jul 15, 2023

Actually, I'm going to verify some other issues with all-user installation for Linux; converting back to draft.

@mrclary mrclary marked this pull request as ready for review July 16, 2023 23:13
@mrclary mrclary marked this pull request as draft July 16, 2023 23:17
@mrclary
Copy link
Contributor Author

mrclary commented Jul 16, 2023

@ccordoba12, thanks for your previous review; I've made the suggested correction. Additionally, when installing for all users, each user's shell startup will have the Spyder launch alias. The uninstall alias is only included for user-only install.

@mrclary mrclary marked this pull request as ready for review July 16, 2023 23:47
@ccordoba12
Copy link
Member

@mrclary, looks good to me now, but I'd like to ask you if you have tested the admin install in a VM. I'd like to help you with that but I don't want to mess with my system.

@mrclary
Copy link
Contributor Author

mrclary commented Jul 17, 2023

@mrclary, looks good to me now, but I'd like to ask you if you have tested the admin install in a VM. I'd like to help you with that but I don't want to mess with my system.

Yes, I've tested the admin install on my Ubuntu VM. I added a test user as well and confirmed that the Spyder alias is properly created and Spyder launches for all accounts.

Note that constructor does not provide a default install location for all users on admin installs; /usr/spyder-6 (or wherever) must be specified either with -p flag or at the interactive prompt. Otherwise the environment prefix will fall back to /root/.local/spyder-6 which will causes a permission denied error for any user other than root.

Ping @jaimergp.

@mrclary
Copy link
Contributor Author

mrclary commented Jul 17, 2023

@ccordoba12, I've removed the uninstall Spyder alias from shell startup for admin installs because it requires sudo privileges and when invoking sudo the alias isn't recognized anyway. Should the uninstall Spyder alias be added to /root/.bashrc in this case?

@ccordoba12
Copy link
Member

Yes, I've tested the admin install on my Ubuntu VM. I added a test user as well and confirmed that the Spyder alias is properly created and Spyder launches for all accounts.

Ok, great!

Note that constructor does not provide a default install location for all users on admin installs; /usr/spyder-6 (or wherever) must be specified either with -p flag or at the interactive prompt. Otherwise the environment prefix will fall back to /root/.local/spyder-6 which will causes a permission denied error for any user other than root.

I think that the default directory should be /opt/spyder-6, but we can add it once constructor has support for it.

I've removed the uninstall Spyder alias from shell startup for admin installs because it requires sudo privileges and when invoking sudo the alias isn't recognized anyway.

Ok, no problem. Then I recommend to show a message saying that system admins need to remove the directory where Spyder was installed plus the desktop file to uninstall it.

Should the uninstall Spyder alias be added to /root/.bashrc in this case?

That probably won't work and the alternatives don't seem promising.

I think adding a proper script in /path/to/install_dir/uninstall-spyder.sh should be enough. The thing is in that case we don't want to provide a global command to uninstall Spyder because regular users won't be able to run it and it doesn't make sense for them.

@ccordoba12
Copy link
Member

Perhaps the instruction to source .bashrc in the current shell should be omitted in the case of admin installs?

Agreed. That part should be replaced by telling users to open a new terminal and start Spyder there.

@mrclary mrclary mentioned this pull request Jul 18, 2023
2 tasks
@mrclary
Copy link
Contributor Author

mrclary commented Jul 18, 2023

@ccordoba12 here is the new message for admin install on Linux.

###############################################################################
#                             !!! IMPORTANT !!!
###############################################################################
Spyder can be launched by standard methods in Gnome and KDE desktop
environments. It can also be launched from the command line on all Linux
distros with the command:

$ spyder

This command will only be available in new shell sessions.

To uninstall Spyder, run the following from the command line:

$ sudo /opt/spyder-6/uninstall-spyder.sh

###############################################################################

@mrclary mrclary force-pushed the bundle_tools_3 branch 2 times, most recently from f767729 to ba9fe93 Compare July 18, 2023 21:54
@ccordoba12
Copy link
Member

@ccordoba12 here is the new message for admin install on Linux.

Looks good to me now, thanks!

Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of additional comments/suggestions, then this should be ready.

installers-conda/resources/post-install.sh Outdated Show resolved Hide resolved
installers-conda/resources/post-install.sh Show resolved Hide resolved
Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last suggestions to prevent overwriting the Spyder desktop file installed by the Linux distro package manager.

.github/workflows/installers-conda.yml Show resolved Hide resolved
installers-conda/resources/post-install.sh Show resolved Hide resolved
@jitseniesen
Copy link
Member

here is the new message for admin install on Linux.

@mrclary Sorry to butt in, but I think it looks more professional to say "distributions" in full instead of "distros".

mrclary and others added 15 commits July 19, 2023 07:11
…_3 channel.

For some reason, conda is taken from conda-forge instead of bundle_tools_3 and setup-micromamba does not provide option to set strict channel priority, so must explicitly use channel for each package.
…-user install on Linux.

Do not alias uninstall script for all-user installation.
Use same sed command options for macOS and Linux
Note that pkill won't close Spyder on macOS; it will terminate Spyder.app/Contents/MacOS/spyder process but not the application. osascript must be used. Also note that if the IPython interpreter is "same as spyder" then osascript will close the kernel (it thinks it is Spyder.app) and not the application. This may be fixed by resolving sys.executable in KernelSpec.
Co-authored-by: Carlos Cordoba <ccordoba12@gmail.com>
Co-authored-by: Jitse Niesen <jitseniesen@yahoo.com>
Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me now, thanks @mrclary!

@ccordoba12 ccordoba12 merged commit 4904d7f into spyder-ide:master Jul 20, 2023
6 checks passed
@mrclary
Copy link
Contributor Author

mrclary commented Jul 20, 2023

@ccordoba12 @jitseniesen @jaimergp, thanks for all your feedback!

@mrclary mrclary deleted the bundle_tools_3 branch July 21, 2023 02:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants