From ed0a382cbeb6d379ffce78ce04759d0ee5c61de7 Mon Sep 17 00:00:00 2001 From: magical Date: Mon, 5 Feb 2024 20:24:15 -0800 Subject: [PATCH] add a script for building an executable zip file see https://docs.python.org/3/library/zipapp.html --- build.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 build.sh diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..460a0c5 --- /dev/null +++ b/build.sh @@ -0,0 +1,22 @@ +#!/bin/bash +set -eu + +mkdir -p myapp + +if ! test -d myapp/bps; then + echo "Installing dependencies to ./myapp" + pip install -r requirements.txt --target myapp + rm -rf myapp/bin/ myapp/bps/test/ myapp/{bps,PySimpleGUI}/__pycache__/ myapp/*.dist-info/ +fi + +echo "Copying source files to ./myapp" +cp Fusion_Graph.py myapp/Fusion_Graph.py +cp Fusion_Items.py myapp/Fusion_Items.py +cp Randomizer.py myapp/Randomizer.py +cp GUI.py myapp/GUI.py +cp MFOR.py myapp/__main__.py + +echo "Building MFOR.pyz" +python3 -m zipapp -o MFOR.pyz --python "/usr/bin/env python3" --compress myapp + +echo "Done"