-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.spec
More file actions
126 lines (112 loc) · 2.62 KB
/
build.spec
File metadata and controls
126 lines (112 loc) · 2.62 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
# -*- mode: python ; coding: utf-8 -*-
from PyInstaller.utils.hooks import collect_all, copy_metadata
import sys
import os
block_cipher = None
# ---------- DATA ----------
datas = [
('web', 'web'),
('logo', 'logo'),
]
binaries = []
# ---------- HIDDEN IMPORTS ----------
hiddenimports = [
'uvicorn.logging',
'uvicorn.loops',
'uvicorn.loops.auto',
'uvicorn.loops.asyncio',
'uvicorn.protocols',
'uvicorn.protocols.http',
'uvicorn.protocols.http.auto',
'uvicorn.protocols.websockets',
'uvicorn.protocols.websockets.auto',
'uvicorn.lifespan',
'uvicorn.lifespan.on',
'fastapi',
'starlette',
'pydantic',
'python_multipart',
'dotenv',
'fitz',
# AI / Audio
'faster_whisper',
'av',
]
# ---------- COLLECT PACKAGES ----------
for pkg in ['faster_whisper', 'av']:
tmp = collect_all(pkg)
datas += tmp[0]
binaries += tmp[1]
hiddenimports += tmp[2]
# ---------- METADATA ----------
packages_to_copy = [
'tqdm',
'regex',
'requests',
'packaging',
'filelock',
'huggingface_hub',
'google-genai',
'numpy',
'uvicorn',
'fastapi',
'av'
]
for pkg in packages_to_copy:
try:
datas += copy_metadata(pkg)
except Exception:
print(f"[WARNING] Metadata not found for {pkg}")
# ---------- ANALYSIS ----------
a = Analysis(
['gui_app.py'],
binaries=binaries,
datas=datas,
hiddenimports=hiddenimports,
excludes=[
'torch',
'noisereduce',
'scipy',
'matplotlib',
'tkinter', 'tcl', 'tk'
],
noarchive=False,
)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name='AudioTTo',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=False, # Disabilitato per evitare problemi con antivirus
upx_exclude=[],
runtime_tmpdir=None,
console=True, # Mostra console per debug
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon='logo/logo_app.ico',
)
if sys.platform == 'darwin':
app = BUNDLE(
exe,
name='AudioTTo.app',
icon='logo/logo_app.icns',
bundle_identifier='com.manumarzo.audiotto',
info_plist={
'NSHighResolutionCapable': 'True',
'CFBundleName': 'AudioTTo',
'CFBundleDisplayName': 'AudioTTo',
'CFBundleVersion': '1.0.0',
'CFBundleShortVersionString': '1.0.0',
'NSRequiresAquaSystemAppearance': 'False',
},
)