I would like to package a complex application made with PyQt and other dependencies, to make it easy to install for macOS and Windows users (Linux users are happy with Flatpak).
I’ve found a myriad of tools to create installers. The most famous appears to be PyInstaller. However, I’m disappointed that PyInstaller is trying to run its own discovery logic for what files should be packaged into my application. This app has assets like icons, etc., plus binary dependencies with shared libraries packaged into wheels. I find it silly to have to tell the tool to include all that, and make sure nothing is missed, while the wheels contain the authoritative list of everything that should be included.
My question is: could you recommend a tool that creates installers, preferably the same tool for macOS and Windows, using package wheels as the single-source-of-truth to determine files to bundle?
Tools like PyInstaller need to introspect the code to figure out dependenies that will not be in the wheels.
Given that these app makes (not really installers) need to cherry pick part of python to keep to app size as small as resonable.
There are two things that need to be discovered, which part of the python stdlib that app uses and the DLLs/dylibs that your app uses. Not all this is in your wheels.
The installers need to know what icon you want for your app so that they can create
the windows .exe with the icon embedded inside it. Also the .app needs
to have the icon is a specific format reference from Apple mandated metadata files.
I package PyQt6 apps for WIndows and macOS myself and I use different tools for each OS.
I use PyInstaller on macOS (was use py2app, but its not working anymore for my
apps) the turn what it creates into a .dmg for distibution.
For windows I use a tool that is like PyInstaller that I’m the author of win-app-packager.
(In the past I was a maintainer of the python2 meinc_installer that I think is the basis of PyInstaller).
Sometimes you need to also install the Windows C/C++ runtime redistributables to allow your app to work on Windows.
I use Inno setup to create a setup.exe to do the installation of the built windows app.
In both cases I build a venv with the app in it and run the tool to create the package from the venv. I use the venv as my single-source-of-truth.
If packaging is done correctly, then dependencies will be in the wheels, even dynamic libraries. The exception is native libraries that I could document as being required but not packaged. In my experience, this is comparatively rare.
Even if there are extra libraries required, I do want all of what’s in the wheels to end up in the installer. In other words, I want the discovery to add extra files if it wants to, but not remove files compared to the distributions (except unused stdlib modules, these are fine to remove).
That is true but I don’t see the link with this topic.