Skip to content

Commit

Permalink
use poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
dromer committed Sep 21, 2024
1 parent e594c9f commit 93e0142
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
11 changes: 6 additions & 5 deletions build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@ xcopy /E /H /C /I dpf-widgets Heavy\usr\lib\dpf-widgets

:: Package heavy using pyinstaller
python -m ensurepip
python -m pip install hvcc\.
python -m pip install pyinstaller
python -m pip install poetry poetry-pyinstaller-plugin

FOR /F "tokens=*" %%g IN ('python -m site --user-site') do (SET PYTHON_SITE=%%g)

python resources\run_pyinstaller.py -n Heavy --noconfirm --windowed --paths %PYTHON_SITE% .\hvcc\hvcc\__init__.py --collect-data json2daisy --add-data=".\hvcc\hvcc\generators;.\generators" --add-data=".\hvcc\hvcc\core;.\hvcc\core" --add-data=".\hvcc\hvcc\generators;.\hvcc\generators" --add-data=".\hvcc\hvcc\interpreters;.\hvcc\interpreters"
cd hvcc
poetry build
cd ..

dir .\dist\pyinstaller\

copy .\dist\Heavy\json2daisy\resources\component_defs.json .\dist\Heavy\json2daisy\resources\seed.json
move .\dist\Heavy .\Heavy\usr\bin\

del /s /q .\dist\*
Expand Down
14 changes: 9 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,20 @@ cp -rf ./dpf-widgets ./Heavy/lib/dpf-widgets

# Package Heavy with pyinstaller
python3 -m ensurepip
python3 -m pip install hvcc/.
python3 -m pip install pyinstaller
python3 -m pip install poetry poetry-pyinstaller-plugin

pushd hvcc
poetry build
popd

if [[ "$OSTYPE" == "linux-gnu"* ]]; then
python3 ./resources/run_pyinstaller.py -n Heavy --noconfirm --paths $(python3 -m site --user-site) ./hvcc/hvcc/__init__.py --collect-data json2daisy --add-data="./hvcc/hvcc/generators:./generators" --add-data="./hvcc/hvcc/core:./hvcc/core" --add-data="./hvcc/hvcc/generators:./hvcc/generators" --add-data="./hvcc/hvcc/interpreters:./hvcc/interpreters"
mv ./hvcc/dist/pyinstaller/manylinux_2_36_x86_64/Heavy Heavy/bin/Heavy
elif [[ "$OSTYPE" == "darwin"* ]]; then
python3 ./resources/run_pyinstaller.py -n Heavy --noconfirm --paths $(python3 -m site --user-site) --target-architecture x86_64 ./hvcc/hvcc/__init__.py --collect-data json2daisy --add-data="./hvcc/hvcc/generators:./generators" --add-data="./hvcc/hvcc/core:./hvcc/core" --add-data="./hvcc/hvcc/generators:./hvcc/generators" --add-data="./hvcc/hvcc/interpreters:./hvcc/interpreters"
ls -l ./hvcc/dist/pyinstaller
exit 1
fi

mv ./dist/Heavy Heavy/bin/Heavy
# mv ./dist/Heavy Heavy/bin/Heavy

rm -rf ./dist
rm -rf ./build
Expand Down

0 comments on commit 93e0142

Please sign in to comment.