Previous slide
Next slide
Toggle fullscreen
Open presenter view
Packaging Python CLIs and GUIs for air-gapped computers
Reto Trappitsch
July 10, 2024
Why should we care?
Home-built instruments require home-built software
Python has a great ecosystem
Instrument control
Data analysis
But: Instrument computers are often air-gapped to run outdated software
We can't just
pip install
dependencies!
The human aspect
Yes, dependency installation can be done offline but it's tricky
Updates require lots of manual work
The user needs to understand the python issues in detail
Overall, it's just not a good situation
Photo by
Elliot Wilkinson
on
Unsplash
Some possible solutions
PyInstaller
:
Works well, but can be tricky
py2exe
:
Windows only (so no!)
PyOxidizer
:
Looked promising
No longer maintained
fbs
- a wrapper around PyInstaller:
Not open source
Works well for GUIs, creates installers
Is it still maintained?
PyApp
- A new solution to an old problem
A wrapper for python packages that bootstrap themselves at runtime
Package a project locally or directly from PyPi
Uses
indygreg's
highly-reproducable builds for
standalone python
Example: Python project manager
hatch
is packaged via PyApp (both developped by
Ofek Lev
)
And what does the user see?
But you mentioned air-gapped machine in the title!
We can provide a standalone python build with all dependencies pre-installed!
PyApp environment variables allow us to skip installation via
pip
upon first run
Thus, no internet connection is required for the user!
My own notes on this:
this GitHub gist
box
ing your apps
Configure your app inside
pyproject.toml
Environment agnostic
Package with PyApp for CLIs or GUIs
Create installers for Linux, Windows, and MacOS
Runs on GitHub actions
NOT
production ready!
Questions?
Where can I try all of this?
PyApp:
repo
,
docs
Box:
repo
,
docs
You forgot [insert alternative here]!
Not actually a question ;)
Please let me know though!
Where can I find all the links and slides?
https://galactic-forensics.space
Can I test this? Yes please!
Can I help? Yes please, let's talk!