innovationOUtside / nbev3devsim

Ev3DevSim ipywidget in Jupyter notebooks
Apache License 2.0
5 stars 0 forks source link

Standalone electron bundled version #52

Open psychemedia opened 4 years ago

psychemedia commented 4 years ago

An issue in the streamlit repo raises the interesting question of bundling a python environment inside/as part of an electron app distribution.

This approach would have the advantage of providing simple standalone electron app containing it's own python/jupyter runtime which could simplify distribution matters somewhat (i.e. there would be no docker requirement).

SimonBiggs commented 4 years ago

I'm keen to see the progress :)

psychemedia commented 4 years ago

@SimonBiggs Me too! (Got to push on some teaching materials for looming handover deadline first, then I'll come back to this... It also ties in with another course where we want to deliver teaching materials locally rather than via a VLE, and a small py envt could be really useful for eg sandboxed Python coding quiz questions.)

psychemedia commented 4 years ago

In passing, here's another route for distributing Python applications: pipx, "a tool to help you install and run end-user applications written in Python". Based on pip, it "is focused on installing and managing Python packages that can be run from the command line directly as applications".

And also things like the proof of concept jupyter_notebook_pyinstaller, which uses pyinstaller (and which in turn "freezes (packages) Python applications into stand-alone executables, under Windows, GNU/Linux, Mac OS X, FreeBSD, Solaris and AIX.").

SimonBiggs commented 4 years ago

I side stepped using pyinstaller as it strips out a lot of code of the dependencies attempting to make the install size smaller. But I want to be able to distribute packages in their original form, in full, so that users can do new things with the installation.

I hadn't considered pipx, I had been avoiding using a package manager on the users system... not having explicit pinning for a final application installable may make reproduciblity be variable. I guess, by pre-bundling all the dependencies the question of "will this work if installed in 5 years" is answerable. For other options I have found, not so much...

psychemedia commented 4 years ago

Re: pipx, yes, good point. I ideally want to minimise the additional requirements too. Every additional requirement / install is another reason for folk not to try something out, another set of issues to resolve with someone's weird local set-up that means the requirement doesn't work properly etc!