-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from f1shl/pyinstaller_build
Added more robust handling of the PDF file from DPSG.
- Loading branch information
Showing
9 changed files
with
121 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "pynami"] | ||
path = pynami | ||
url = https://github.com/sscholz93/pynami.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
pyinstaller --clean --onefile --windowed --name "Nami Beitragsrechner" --osx-bundle-identifier "com.nami-beitragsrechner" --icon="img/favicon.ico" --collect-data sv_ttk --collect-data pycountry --copy-metadata schwifty --hidden-import babel.numbers --add-data="venv/lib/python3.10/site-packages/schwifty/bank_registry/:bank_registry" --add-data="venv/lib/python3.10/site-packages/schwifty/iban_registry/:iban_registry" --add-data="img/dpsg_logo.png:img" --add-data="img/favicon.ico:img" main.py | ||
|
||
bash init_venv.sh | ||
source .venv/bin/activate | ||
pyinstaller main.spec | ||
deactivate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
echo "Creating venv" | ||
python3 -m venv .venv | ||
source .venv/bin/activate | ||
pip install --upgrade pip | ||
echo "Installing python packages from requirements.txt" | ||
pip install -r requirements.txt | ||
deactivate | ||
|
||
echo "Successfully created venv for nami-beitragsrechner" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# -*- mode: python ; coding: utf-8 -*- | ||
from PyInstaller.utils.hooks import collect_data_files | ||
from PyInstaller.utils.hooks import copy_metadata | ||
import platform | ||
|
||
python_version = platform.python_version() | ||
last_dot = python_version.rfind('.') | ||
python_version = python_version[0:last_dot] | ||
datas = [('img/dpsg_logo.png', 'img'), ('img/favicon.ico', 'img')] | ||
datas.append((f'.venv/lib/python{python_version}/site-packages/schwifty/bank_registry/', 'bank_registry')) | ||
datas.append((f'.venv/lib/python{python_version}/site-packages/schwifty/iban_registry/', 'iban_registry')) | ||
datas += collect_data_files('sv_ttk') | ||
datas += collect_data_files('pycountry') | ||
datas += collect_data_files('schwifty') | ||
datas += copy_metadata('schwifty') | ||
|
||
|
||
block_cipher = None | ||
|
||
|
||
a = Analysis( | ||
['main.py'], | ||
pathex=[], | ||
binaries=[], | ||
datas=datas, | ||
hiddenimports=['babel.numbers'], | ||
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='Nami Beitragsrechner', | ||
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, | ||
icon=['img/favicon.ico'], | ||
) | ||
app = BUNDLE( | ||
exe, | ||
name='Nami Beitragsrechner.app', | ||
icon='img/favicon.ico', | ||
bundle_identifier='com.nami-beitragsrechner', | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters