Repository navigation
Expand file tree
/
Copy pathTimeTrack.spec
More file actions
105 lines (97 loc) · 3.12 KB
/
Copy pathTimeTrack.spec
File metadata and controls
105 lines (97 loc) · 3.12 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
# -*- mode: python ; coding: utf-8 -*-
# TimeTrack — PyInstaller spec (--onedir, no console)
#
# Build with: build.bat OR .venv\Scripts\pyinstaller.exe TimeTrack.spec
#
# Output: dist\TimeTrack\TimeTrack.exe (self-contained directory)
from PyInstaller.utils.hooks import collect_all
import build_version_info
_version_file = build_version_info.write()
# uvicorn and anyio use dynamic plugin loading — collect everything
_uvi_d, _uvi_b, _uvi_h = collect_all('uvicorn')
_any_d, _any_b, _any_h = collect_all('anyio')
block_cipher = None
a = Analysis(
['tray.py'],
pathex=['.'],
binaries=_uvi_b + _any_b,
datas=[
('ui', 'ui'), # HTML dashboard files
('images/timetrack/favicon_1.png','images/timetrack'), # tray/favicon assets
# El .ico va embebido en el PE como icono del ejecutable, pero además se
# necesita como fichero: las notificaciones lo copian al directorio de
# datos para registrarlo como icono del remitente en los toast.
('images/timetrack/TimeTrack.ico','images/timetrack'),
] + _uvi_d + _any_d,
hiddenimports=_uvi_h + _any_h + [
# pystray Windows backend
'pystray._win32',
# Windows registry (built-in, but explicit for frozen builds)
'winreg',
# pydantic v2 internals
'pydantic',
'pydantic_core',
'pydantic.deprecated.class_validators',
# win11toast (optional — app falls back gracefully if unavailable)
'win11toast',
# FastAPI / starlette
'fastapi',
'starlette',
'starlette.routing',
'starlette.middleware',
'starlette.middleware.cors',
# HTTP parsers used by uvicorn
'h11',
'httptools',
# python-multipart: FastAPI lo importa de forma diferida al procesar
# UploadFile/File(). Sin declararlo, subir carátulas falla SOLO en el .exe.
'multipart',
'python_multipart',
# Backend del tray y generación de iconos
'PIL',
'PIL.Image',
'PIL.ImageDraw',
],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[
# Exclude heavy unused packages to keep the build small
'tkinter', 'matplotlib', 'numpy', 'pandas', 'scipy',
'IPython', 'jupyter', 'notebook',
],
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='TimeTrack',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=False, # no console window (equivalent to pythonw.exe)
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon='images/timetrack/TimeTrack.ico', # generated by build.bat from images/timetrack/favicon_1.png
version=_version_file,
)
coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name='TimeTrack',
)