SimonBiggs / scriptedforms

Quickly create live-update GUIs for Python packages using Markdown and simple HTML elements.
Apache License 2.0
508 stars 34 forks source link

Investigate creating .exe of scriptedforms #183

Closed robmarkcole closed 6 years ago

robmarkcole commented 6 years ago

I've had a request from a colleague to distributed a scriptedform as a .exe which includes all dependencies (python). How small could this be? Sub 300 MB? Is there a way to avoid numpy/pandas?

SimonBiggs commented 6 years ago

There is a way to avoid numpy/pandas. But that won't shrink the size much. And it would be a lot of work pulling pandas out (would have to make a version that doesn't have tables).

Have a look into https://www.pyinstaller.org/.

Let me know how you go.

SimonBiggs commented 6 years ago

In a very early prototype of this package I was aiming to do exactly this from the get go:

https://github.com/SimonBiggs/ScriptedQAForms

SimonBiggs commented 6 years ago

In fact, early commits of this repository also have a better bundling system:

https://github.com/SimonBiggs/scriptedforms/tree/6b0ec9dffec6b5c3ee88dc913bb6cb72d29d5418

SimonBiggs commented 6 years ago

Have a look into this one:

https://github.com/SimonBiggs/scriptedforms/tree/6b0ec9dffec6b5c3ee88dc913bb6cb72d29d5418

That will be the way to do it...

SimonBiggs commented 6 years ago

These are the commits where I achieved this:

https://github.com/SimonBiggs/scriptedforms/commits/75146317c7e6e6c34b5da721a63ecab1a6db1d34?after=75146317c7e6e6c34b5da721a63ecab1a6db1d34+139

SimonBiggs commented 6 years ago

@robmarkcole

So I ran into lots of issues making an actual .exe file. But I was able to make a portable version of ScriptedForms, doesn't require any installation, it all sits in one .zip file, you should just download the zip and run the .bat script.

The portable version is downloadable from: https://github.com/SimonBiggs/scriptedforms/releases/download/0.7.1/scriptedforms.zip

The zip file is just under 100 MB. When extracted it takes up 240 MB. You asked for less than 300 MB :), it meets that requirement :). ... but not by much.

This is as far as I am willing to go on this for now. Let me know if you find this useful.

robmarkcole commented 6 years ago

@SimonBiggs the portable version works great, thanks for your effort on this. Hopefully others will find it useful too, and I would encourage you to put this in the main readme

SimonBiggs commented 6 years ago

Glad to hear it :). Let's put the portable version through its paces for a bit, make sure nothing weird happens with it.

Then yes, I agree, making it more prominently displayed would be helpful to others.

SimonBiggs commented 6 years ago

Also, this portable version might work on that PC that couldn't find python...