Open crazyideas21 opened 10 months ago
Non-ideas:
streamlit
is its simplicity in the development process. We just have to figure out the deployment issue!A few ideas: Use pyoxy
as a standalone executable for Python on macOS. I haven't tested it. We will not worry about code-signing for now.
You can download a precompiled executable from https://github.com/indygreg/python-build-standalone/releases (basically from the PyOxidizer project).
I was inspired by how the datasette
project distributes its macOS app: https://github.com/simonw/datasette-app/blob/main/download-python.sh
If this technique works, we could ship the pyoxy
binary, have it masquerade as Python (per this post), and just run python -m streamlit run Device_List.py
-- if this works.
Related idea: Or just package the Python interpreter with PyInstaller? Would this work?
Or this idea: See this article on how to use PyInstaller to package streamlit
apps.
We currently deploy IoT Inspector on Windows by bundling the official binary of Python 3.8 and installing the required packages during the initial setup process. See this Windows shortcut file for details.
This process does not work for macOS, as there is no single standalone executable/binary for macOS.
I don't think (I might be wrong) we can use PyInstaller because of
streamlit
. As you go through the code, you'll see that the UI/UX for IoT Inspector is based onstreamlit
. To run Inspector, you'll have to put IoT Inspector's code as an argument tostreamlit
; see this line, i.e., effectively runningpython -m streamlit run Device_List.py
. Although we can packagestreamlit
with PyInstaller, PyInstaller can't deal with the dependencies for the IoT Inspector code (i.e.,Device_List.py
and others). I haven't found a way to launch IoT Inspector without first launchingstreamlit
. In other words, it seems impossible to just do this:./Device_List.py
, whereDevice_List.py
could somehow launch thestreamlit
server internally without needing to dopython -m streamlit run Device_List.py
.If we can launch IoT Inspector with just
./Device_List.py
orpython Device_List.py
, then the problem would be solved; we could simply processDevice_List.py
with PyInstaller, and PyInstaller will take care of the dependencies.This is a critical issue. Until the above is solved, it's difficult to have a proper/easy macOS deployment.