mamba-org / mamba

The Fast Cross-Platform Package Manager
https://mamba.readthedocs.io
BSD 3-Clause "New" or "Revised" License
6.76k stars 347 forks source link

Support Micromamba instalation with winget (on Windows 10/11) #2191

Open vasiljevic opened 1 year ago

vasiljevic commented 1 year ago

Micromamba is a great tool for standalone Python Conda envs and the winget package manager is bundled with Windows 11 and newer versions of Windows 10.

If we were able to install micromamba using winget we could make a simpe batch script to install a standalone Python env on any newer Windows desktop without non-trivial prerequirements.

A sample hypothetical batch script:

winget install -e --id Mamba.Micromamba
micromamba create -f env.yml
jonashaag commented 1 year ago

Nice idea, do you know what needs to be done to support this?

vasiljevic commented 1 year ago

First, you need to provide a Windows binary installer for Micromamba either as MSIX, MSI or .exe application installer.

Then you have to specify some metadata and submit the package. I have found official instructions (but have never did it myself):

https://learn.microsoft.com/en-us/windows/package-manager/package

A I understand, as a GitHub community member you can submit an issue in the repo https://github.com/microsoft/winget-pkgs , select "New Package (Request/Submission)", and then you will get the form:

image
jonashaag commented 1 year ago

Would you be willing to come up with an initial version? Maybe we can ship the exe file directly without using an installer (since we don’t have any)

vasiljevic commented 1 year ago

Maybe we can ship the exe file directly without using an installer

I don't think so. An installer must register installed application, copy executable file(s) into Program Files (when installing for all users) or AppData\Local\Programs inside the home directory of the current user, set PATH (optionally), provide uninstall procedure, etc.

There are many tools to create Windows installers, but that's where my knowledge ends. I am even not sure which tool is good choice for a project like this.

Looks like we need help from someone who have experience with building Windows installers.

jonashaag commented 1 year ago

Maybe there examples of similar programs in winget that we can copy paste.

vasiljevic commented 1 year ago

I have dig a little bit through other winget package requests in https://github.com/microsoft/winget-pkgs using this query:

https://github.com/microsoft/winget-pkgs/issues?q=is%3Aissue+is%3Acompleated+is%3Aclosed+label%3APackage-Request+%22Installer+URL%3A+https%3A%2F%2Fgithub.com%22

This project could be an useful example: https://github.com/aloneguid/clipnest

Clipnest use Nullsoft scriptable install system GitHub action: https://github.com/joncloud/makensis-action

Here is the action in the Clipnest's GitHub workflow file: https://github.com/aloneguid/clipnest/blob/master/.github/workflows/build.yml#L63

And here is the Nullsoft scriptable install system configuration file: https://github.com/aloneguid/clipnest/blob/master/install.nsi

Nullsoft scriptable install system homepage: https://nsis.sourceforge.io/

vasiljevic commented 1 year ago

I have found another useful example of an open source project that implements windows installers and have winget integrated into the release process. It is Neovim (https://github.com/neovim/neovim). Here are installation instructions for end users including winget option: https://github.com/neovim/neovim/wiki/Installing-Neovim

Looks like Neovim have switched from Nullsoft scriptable install system to Wix toolset (https://github.com/wixtoolset/). Here is the commit named "refactor(packaging): Windows: improve MSI, remove NSIS": https://github.com/neovim/neovim/commit/96b461a00042c13610a62545b17fb792eb17c12e

Mentioned commit also may be a good starting point for an exploration how Neovim implements windows installer build and winget publishing.

JDFagan commented 11 months ago

Would be nice to up the priority on this. Just spent half a day trying to get Git Bash install working properly on Windows 11 but its not working as expected. Got as far as it modifying my .bash_profile but something isn't working right and running which micromamba on new fresh git bash (which I verified is running the .bash_profile code) doesn't find micromamba..

carschandler commented 6 months ago

As of today, micromamba is available at Mamba.Micromamba from winget. Can this be closed now?

serverhorror commented 2 hours ago

I just installed, but the binary is not on PATH.

Yes, I did restart the terminal. Still no success :(