-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcybercrew.spec
More file actions
172 lines (153 loc) · 5.09 KB
/
cybercrew.spec
File metadata and controls
172 lines (153 loc) · 5.09 KB
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# -*- mode: python ; coding: utf-8 -*-
# CyberCrew v2.0 — PyInstaller Spec File
#
# Usage:
# Linux: pyinstaller cybercrew.spec
# Windows: pyinstaller cybercrew.spec
#
# Outputs:
# Linux: dist/CyberCrew-v2.0/CyberCrew-v2.0 (folder mode; wrap with AppImage)
# Windows: dist/CyberCrew-v2.0/CyberCrew-v2.0.exe
import sys
import os
from pathlib import Path
block_cipher = None
# ── Project root ────────────────────────────────────────────────────────────────
ROOT = Path(SPECPATH)
# ── Collect all source packages ─────────────────────────────────────────────────
from PyInstaller.utils.hooks import collect_all, collect_data_files, collect_submodules
# SQLModel / SQLAlchemy hidden imports
sqlalchemy_hiddens = collect_submodules('sqlalchemy')
sqlmodel_hiddens = collect_submodules('sqlmodel')
pydantic_hiddens = collect_submodules('pydantic')
# PyQt6 hidden imports
pyqt6_hiddens = collect_submodules('PyQt6')
# WeasyPrint hidden imports (font stack, Cairo, Pango)
weasyprint_hiddens = collect_submodules('weasyprint')
weasyprint_data = collect_data_files('weasyprint')
# PyQtGraph
pyqtgraph_data = collect_data_files('pyqtgraph')
# Jinja2 templates
jinja2_data = collect_data_files('jinja2')
# ── Hidden imports list ──────────────────────────────────────────────────────────
hidden_imports = [
# SQLAlchemy dialects
'sqlalchemy.dialects.sqlite',
'sqlalchemy.pool',
'sqlalchemy.orm',
'sqlalchemy.sql',
# Pydantic
'pydantic.v1',
'pydantic_core',
# PyQt6 modules explicitly needed
'PyQt6.QtCore',
'PyQt6.QtGui',
'PyQt6.QtWidgets',
'PyQt6.QtSvg',
# PyQtGraph
'pyqtgraph',
'pyqtgraph.graphicsItems',
'pyqtgraph.Qt',
# WeasyPrint and font dependencies
'weasyprint',
'weasyprint.fonts',
'weasyprint.document',
'tinycss2',
'cssselect2',
'html5lib',
'Pillow',
'PIL',
# Jinja2
'jinja2',
'jinja2.ext',
'markupsafe',
# Standard library modules that may be missed
'email',
'json',
'pathlib',
'datetime',
'hashlib',
'shutil',
'subprocess',
'uuid',
'logging',
'traceback',
're',
'struct',
'threading',
'queue',
] + sqlalchemy_hiddens + sqlmodel_hiddens + pydantic_hiddens + weasyprint_hiddens
# ── Data files (non-Python assets) ───────────────────────────────────────────────
datas = [
# Application fonts
(str(ROOT / 'assets' / 'fonts'), 'assets/fonts'),
# Any additional static assets
(str(ROOT / 'assets'), 'assets'),
] + weasyprint_data + pyqtgraph_data + jinja2_data
# ── Binaries (platform-specific shared libs) ─────────────────────────────────────
binaries = []
# ── Analysis ─────────────────────────────────────────────────────────────────────
a = Analysis(
[str(ROOT / 'main.py')],
pathex=[str(ROOT)],
binaries=binaries,
datas=datas,
hiddenimports=hidden_imports,
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[
# Exclude unused heavy libraries
'tkinter',
'matplotlib',
'scipy',
'pandas',
'IPython',
'jupyter',
'notebook',
'sphinx',
'docutils',
'xmlrpc',
'_pytest',
'pytest',
],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False,
)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
# ── Executable ───────────────────────────────────────────────────────────────────
exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name='CyberCrew-v2.0',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=False, # No console window on Windows
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon=str(ROOT / 'assets' / 'icon.ico') if sys.platform == 'win32' else None,
version='version_info.txt' if sys.platform == 'win32' else None,
)
# ── Collection (folder output for AppImage wrapping) ─────────────────────────────
coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
upx_exclude=[
'libpython*.so',
'libQt6*.so',
],
name='CyberCrew-v2.0',
)