ofek / pyapp

Runtime installer for Python applications
https://ofek.dev/pyapp/
1.1k stars 24 forks source link

Offline installation with local archive file #94

Open Jakob-Stadler opened 3 months ago

Jakob-Stadler commented 3 months ago

Hi there,

I came across in this project in the search of a way to distribute Python report builder scripts to my non-programmer colleagues. So far I've been using pyinstaller to build one-file executables that are placed on a (slow, non-local) network share. Adding a few "heavier" dependencies (like pandas, etc.) causes the file size to balloon in size and slow down startup times to a crawl. Other solutions like having users install the executable locally cause issues by users staying on outdated versions. I want there to be one source of truth and only one way to start it.

I really like the approach of one executable installing and "caching" itself locally on the user's machine and then just delegate the call to the cache for faster startup times after the first run.

However, I have a hit a few road blocks while testing pyapp for this purpose:

So I would love to have a way to embed all the data, but without actually embedding it. Instead, the executable itself should be as tiny as possible to speed up startup times and delegate the call to the local installation. Only if the local installation is not available (or the management interface is called), it should read and map a blob file placed nearby that contains the all the code and data required for the full operation of pyapp.

It would look something like this:

///network/share/directory/
  - create_XYZ_report.exe  <-- tiny executable with the bare essentials to locate the local cache
  - create_XYZ_report.blob <-- all the code and data required to deploy for the first run