-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.spec
90 lines (82 loc) · 2.26 KB
/
main.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# -*- mode: python ; coding: utf-8 -*-
import shutil
from pathlib import Path
import pywr
import tables
from win32com.propsys import propsys
block_cipher = None
win32_module_path = Path(propsys.__file__).parent
pywr_dist = list(Path(pywr.__file__).parent.parent.glob("pywr-*"))[0]
a = Analysis(
["main.py"],
binaries=[
(win32_module_path / "propsys.pyd", "win32com\propsys"),
(win32_module_path / "pscon.py", "win32com\propsys"),
(Path(tables.__file__).parent / "libblosc2.dll", "tables"),
],
datas=[
("LEGAL NOTICES.md", "."),
("pywr_editor/assets/ico/Pywr Editor.ico", "."),
# Pywr hidden imports are not copied. Copy the full package content
(Path(pywr.__file__).parent, "pywr"),
# pywr __init__.py relies on the dist info folder to set __version__.
# This must be manually copied
# (pywr_dist.as_posix(), pywr_dist.name),
],
hiddenimports=[
"json",
"pandas",
"logging",
"logging.config",
"pyqtgraph",
"tables",
"pywr",
"pkg_resources",
"platformdirs",
"PySide6.QtSvg",
"PySide6.QtAxContainer",
"PySide6.QtSvgWidgets",
],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=["matplotlib", "jedi", "IPython", "sqlite3"],
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,
[],
exclude_binaries=True,
name="Pywr Editor",
icon="pywr_editor/assets/ico/Pywr Editor.ico",
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=False,
disable_windowed_traceback=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
contents_directory='.',
)
coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name="main",
)
# PyInstaller does not want to copy the following files/folder in the data attr
shutil.copytree(pywr_dist.as_posix(), f"./dist/main/{pywr_dist.name}")
shutil.copyfile(
Path(tables.__file__).parent / "libblosc2.dll", "./dist/main/tables/libblosc2.dll"
)