opulo-inc / farm-upload

A bulk file uploading tool for 3D printer farms.
https://opulo.io/
Other
36 stars 13 forks source link

Switch to Nuikta for cross-platform compilation #3

Open henrygrv opened 3 months ago

henrygrv commented 3 months ago

Nuitka is a compiler for Python code that will produce an executable for macOS (Darwin), Linux, Windows and FreeBSD, that can be run even without a python installation.

To compile, it would be as simple as:

python3 -m nuitka \
--onefile --enable-plugin=tk-inter \
--macos-create-app-bundle --macos-app-icon=img/icon.png \
--windows-icon-from-ico=img/icon.png src/FarmUpload.py

It also has the ability to embed lots of metadata (see here)

If you think this would be worth doing, I can create a GitHub workflow to automatically create builds and package them in a release?

mardab commented 3 months ago

A big hiccup might be licensing, as this is clearly a commercial-oriented software to protect commercial software prototyped in Python. Given that current farm-upload only needs Python and Tk to start from source, which can be accomplished with a small script or a few clicks on every major platform, I do believe such packaging for everyone is not yet necessary.

henrygrv commented 3 months ago

A big hiccup might be licensing, as this is clearly a commercial-oriented software to protect commercial software prototyped in Python.

Nuitka is licenced under Apache v2, which allows modified code to be redistributed under a different licence.

And yes, whilst I agree that packaging into an executable is perhaps overkill, wouldn't it be better to provide it than not? One cannot assume the skill level of those wishing to use open source code.

Stephen is already providing a .app for macOS users, why shouldn't there be an equivalent for GNU/Linux and Windows?

mardab commented 3 months ago
  1. Most popular Linux distributions with graphical environment require proper Python setup to function, if required Python package is missing, it can be checked and fixed upon program's start (lack of requirements.txt leads me to believe that this was never considered), with a calls to --user installation requiring no elevated privileges to perform those operations

  2. Equally, with package/installer for MacOS/Windows, it would be a one time software engineering effort to fault-proof checking and optionally installing Python just to be able to start (bootstrap) program, which can call pip (see point 1.), this way dependency checking/installing is eventually exactly the same across all platforms from the point of the program, and single change to dependencies list, as needed, is reflected across all platforms.

  3. Why would you need to make an open-source Python-based program opaque? Without that, most basic development/debug setup could be achieved with editing source .py files in the installation directory, arguable feature, but unarguably easier than digging through artifacts of this cross-compiler, however complex they may be.