-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy-4-developer.spec
More file actions
233 lines (212 loc) · 5.04 KB
/
deploy-4-developer.spec
File metadata and controls
233 lines (212 loc) · 5.04 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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
# -*- mode: python ; coding: utf-8 -*-
"""
PyInstaller spec file for deploy-4-developer
Supports: Windows, Linux, macOS
"""
import sys
import os
from pathlib import Path
# Project configuration
PACKAGE_NAME = 'deploy-4-developer'
EXECUTABLE_NAME = 'deploy4dev'
VERSION = '0.0.1'
# Entry point
main_script = 'src/deploy_4_developer/cli/deploy.py'
# Paths
src_path = Path('src')
package_path = src_path / 'deploy_4_developer'
# Collect data files (if any configuration files, templates, etc.)
datas = []
# Example: Include README or other resources (optional)
if Path('README.md').exists():
datas.append(('README.md', '.'))
# Binary files (platform-specific crypto libraries)
binaries = []
# Hidden imports (modules that PyInstaller might miss)
hiddenimports = [
'deploy_4_developer',
'deploy_4_developer.cli',
'deploy_4_developer.cli.deploy',
'deploy_4_developer.cli.sys_util',
# Core dependencies
'paramiko',
'paramiko.transport',
'paramiko.client',
'paramiko.rsakey',
'paramiko.dsskey',
'paramiko.ecdsakey',
'paramiko.ed25519key',
'paramiko.ssh_exception',
'paramiko.sftp_client',
'paramiko.channel',
'paramiko.config',
'paramiko.hostkeys',
# Paramiko dependencies
'cryptography',
'cryptography.hazmat',
'cryptography.hazmat.primitives',
'cryptography.hazmat.backends',
'cryptography.hazmat.backends.openssl',
'bcrypt',
'nacl',
'nacl.signing',
'nacl.public',
# Standard library modules that might be missed
'argparse',
'getpass',
'json',
'logging',
'os',
'pathlib',
'subprocess',
]
# Exclude unnecessary modules to reduce size
excludes = [
# GUI frameworks
'tkinter',
'PyQt5',
'PyQt6',
'PySide2',
'PySide6',
'wx',
# Large libraries not needed
'numpy',
'pandas',
'matplotlib',
'scipy',
'PIL',
'cv2',
'torch',
'tensorflow',
'sklearn',
# Development/testing tools
'pytest',
'unittest',
'IPython',
'jupyter',
'notebook',
'pdb',
'doctest',
# Web frameworks
'flask',
'django',
'aiohttp',
'fastapi',
# Database
'sqlite3',
'sqlalchemy',
'psycopg2',
'pymongo',
]
block_cipher = None
a = Analysis(
[main_script],
pathex=[str(src_path)],
binaries=binaries,
datas=datas,
hiddenimports=hiddenimports,
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=excludes,
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False,
optimize=2, # Python bytecode optimization level (0, 1, 2)
)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
# Platform-specific executable configuration
if sys.platform == 'win32':
# Windows executable
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name=EXECUTABLE_NAME,
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True, # Console application
disable_windowed_traceback=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon=None, # Add .ico file path if you have one
)
elif sys.platform == 'darwin':
# macOS executable
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name=EXECUTABLE_NAME,
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True,
disable_windowed_traceback=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)
# Optional: Create macOS app bundle
app = BUNDLE(
exe,
name=f'{EXECUTABLE_NAME}.app',
icon=None, # Add .icns file path if you have one
bundle_identifier=f'com.bytebiscuit.{PACKAGE_NAME}',
info_plist={
'NSPrincipalClass': 'NSApplication',
'NSHighResolutionCapable': 'True',
'CFBundleShortVersionString': VERSION,
},
)
else:
# Linux executable
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name=EXECUTABLE_NAME,
debug=False,
bootloader_ignore_signals=False,
strip=True, # Strip symbols on Linux
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True,
disable_windowed_traceback=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)
# Alternative: COLLECT mode (creates a folder with all dependencies)
# Uncomment the following if you prefer a directory distribution instead of a single executable
"""
coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name=EXECUTABLE_NAME
)
"""