mokapot icon indicating copy to clipboard operation
mokapot copied to clipboard

[Question] executable(e.g. pyinstaller)

Open timosachsenberg opened this issue 2 years ago • 7 comments
trafficstars

Hi, thanks for the great tool and for making it open source.

Do you know if it is easily possible/has some experience to create executables for different platforms for mokapot?

Best

timosachsenberg avatar Apr 19 '23 07:04 timosachsenberg

Hi @timosachsenberg 👋 - I'm glad mokapot has been useful. Also, thank you for all of the great open-source work you do too!

We're working on some major upgrades to mokapot currently (see #96 and #100 if curious), so I would want to look into this after we get those in place. I have fairly limited experience with pyinstaller, but @jspaezp might be able to comment how difficult it would be for mokapot.

I don't know if its helpful, but in the meantime we do already build a Docker image as part of our CI/CD: https://github.com/wfondrie/mokapot/pkgs/container/mokapot

wfondrie avatar Apr 19 '23 16:04 wfondrie

Hello there!

I think it depends a bit on what the intended use is ... The easiest implementation would be to just have the cli be an executable that can be downloaded instead of installed via pip/pipx/docker (which is not too hard to do...); but I do not see a lot of value in it, since it would be just as hard to use.

On the other hand, having an executable that bundles some form of GUI (I am thinking something like the first release of fragpipe), would entail some more care.

Would you mind elaborating on how you would like to use the executable version?

[Thinking more about it, I can see it being used in the case where you want to run it on a computer, and cannot install either python or docker on it, but I am unsure of how common this is. Having said that in my experience you need admin access to run pyinstaller apps (since you need to authorize the executable), which would further restrict the "surface area" covered by the app]

jspaezp avatar Apr 19 '23 18:04 jspaezp

I think one main motivation would be to create a drop-in replacement for the percolator executables (mac,linux,windows) e.g. in existing workflows (without having to care about the user being able to install python and all dependencies etc.).

timosachsenberg avatar Apr 19 '23 18:04 timosachsenberg

@timosachsenberg that sounds like a good enough motivation to be honest! I think I could make a quick "prototype script" if you are willing to build it yourself for a tool you are using (while/if we add it to the regular release artifacts). @wfondrie want to add this to the roadmap of the project? I could make a proof of concept branch in the meantime, while we do the major upgrades to the project.

jspaezp avatar Apr 24 '23 02:04 jspaezp

sounds great. happy to test it

timosachsenberg avatar Apr 24 '23 07:04 timosachsenberg

May be of interest for this thread: As part of compomics/ms2rescore, Mokapot is also packaged into the executable with a one-click installer. For this we use:

As this works for a package with Mokapot as dependency, I see no issues to use the same approach for Mokapot by itself.

If you have not yet started on this, @jspaezp, I can easily open a PR that implements this for Mokapot.

RalfG avatar Oct 16 '23 21:10 RalfG

@RalfG Indeed I have not started tackling this, I would be happy to review the PR!

jspaezp avatar Oct 16 '23 21:10 jspaezp