|
| 1 | +# -*- mode: python -*- |
| 2 | +import shutil |
| 3 | +import subprocess |
| 4 | +import os |
| 5 | +from cdprep import __version__ |
| 6 | +from cdprep.utils.ospath import delete_folder_recursively |
| 7 | + |
| 8 | +block_cipher = None |
| 9 | + |
| 10 | +added_files = [('../cdprep/ressources/icons/*.png', 'ressources/icons'), |
| 11 | + ('../cdprep/ressources/icons/*.svg', 'ressources/icons')] |
| 12 | +a = Analysis(['../cdprep/app/mainwindow.py'], |
| 13 | + pathex=['C:\\Program Files (x86)\\Windows Kits\\10\\Redist\\ucrt\\DLLs\\x64'], |
| 14 | + binaries=[('C:\\Windows\\System32\\vcruntime140_1.dll', '.')], |
| 15 | + datas=added_files , |
| 16 | + hiddenimports=[ |
| 17 | + 'win32timezone', 'pkg_resources.py2_warn'], |
| 18 | + hookspath=[], |
| 19 | + runtime_hooks=[], |
| 20 | + excludes=['PySide', 'PyQt4'], |
| 21 | + win_no_prefer_redirects=False, |
| 22 | + win_private_assemblies=False, |
| 23 | + cipher=block_cipher) |
| 24 | +pyz = PYZ(a.pure, a.zipped_data, |
| 25 | + cipher=block_cipher) |
| 26 | +exe = EXE(pyz, |
| 27 | + a.scripts, |
| 28 | + exclude_binaries=True, |
| 29 | + name='cdprep', |
| 30 | + debug=False, |
| 31 | + strip=False, |
| 32 | + upx=True, |
| 33 | + console=True, |
| 34 | + icon='cdprep.ico') |
| 35 | +coll = COLLECT(exe, |
| 36 | + a.binaries, |
| 37 | + a.zipfiles, |
| 38 | + a.datas, |
| 39 | + strip=False, |
| 40 | + upx=True, |
| 41 | + name='Climate Data Preprocessing Tool') |
| 42 | + |
| 43 | +# Prepare the binary folder. |
| 44 | +shutil.copyfile("../LICENSE", "dist/LICENSE") |
| 45 | +if os.environ.get('AZURE'): |
| 46 | + output_dirname = os.environ.get('CDPREP_OUTPUT_DIRNAME') |
| 47 | +else: |
| 48 | + output_dirname = 'cdprep_'+__version__+'_win_amd64' |
| 49 | +delete_folder_recursively(output_dirname, delroot=True) |
| 50 | +os.rename('dist', output_dirname) |
0 commit comments