diff --git a/.gitignore b/.gitignore index 2d62eb2..1689329 100644 --- a/.gitignore +++ b/.gitignore @@ -110,7 +110,7 @@ MANIFEST # Usually these files are written by a python script from a template # before PyInstaller builds the exe, so as to inject date/other infos into it. *.manifest -*.spec +#*.spec # Installer logs pip-log.txt diff --git a/DHLCropper.spec b/DHLCropper.spec new file mode 100644 index 0000000..b79c9f2 --- /dev/null +++ b/DHLCropper.spec @@ -0,0 +1,49 @@ +# -*- mode: python ; coding: utf-8 -*- +from PyInstaller.utils.hooks import copy_metadata + +datas = [] +datas += copy_metadata('pikepdf') +datas += copy_metadata('dhlcropper') + + +block_cipher = None + + +a = Analysis( + ['dhlcropper/main.py'], + pathex=[], + binaries=[], + datas=datas, + hiddenimports=[], + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False, +) +pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) + +exe = EXE( + pyz, + a.scripts, + a.binaries, + a.zipfiles, + a.datas, + [], + name='DHLCropper', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + upx_exclude=[], + runtime_tmpdir=None, + console=False, + disable_windowed_traceback=False, + argv_emulation=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None, +) diff --git a/build.sh b/build.sh index f3e0424..5319ed9 100755 --- a/build.sh +++ b/build.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash poetry install -poetry run pyinstaller -F --copy-metadata pikepdf --copy-metadata dhlcropper dhlcropper/main.py \ No newline at end of file +poetry run pyinstaller --log-level=WARN --clean DHLCropper.spec \ No newline at end of file diff --git a/makespec.sh b/makespec.sh new file mode 100755 index 0000000..fa76d58 --- /dev/null +++ b/makespec.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +poetry install +poetry run pyi-makespec \ + --onefile \ + --copy-metadata pikepdf \ + --copy-metadata dhlcropper \ + --name DHLCropper \ + --noconsole \ + --log-level=WARN \ + dhlcropper/main.py \ No newline at end of file