forked from Maoleio/CPA-Codex-Manager
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCPA-Codex-Manager-Desktop.spec
More file actions
113 lines (103 loc) · 2.73 KB
/
CPA-Codex-Manager-Desktop.spec
File metadata and controls
113 lines (103 loc) · 2.73 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
# -*- mode: python ; coding: utf-8 -*-
import os
import sys
from pathlib import Path
project_root = Path.cwd()
block_cipher = None
app_name = "CPA-Codex-Manager"
macos_icon = project_root / "assets" / "macOS" / "AppIcon.icns"
if not macos_icon.exists():
macos_icon = project_root / "assets" / "icon.icns"
windows_icon = project_root / "assets" / "icon.ico"
is_macos = sys.platform == "darwin"
is_windows = sys.platform.startswith("win")
build_mode = os.environ.get("APP_BUILD_MODE", "onedir").strip().lower()
is_onefile = build_mode == "onefile"
datas = [
(str(project_root / "templates"), "templates"),
(str(project_root / "static"), "static"),
(str(project_root / ".env.example"), "."),
]
hiddenimports = [
"aiohttp",
"webview",
"uvicorn",
"uvicorn.logging",
"uvicorn.loops.auto",
"uvicorn.protocols.http.auto",
"uvicorn.protocols.websockets.auto",
"uvicorn.lifespan.on",
"websockets",
"websockets.legacy",
"jinja2",
"aiosqlite",
"src.services.outlook.providers.imap_old",
"src.services.outlook.providers.imap_new",
"src.services.outlook.providers.graph_api",
]
a = Analysis(
["desktop.py"],
pathex=[str(project_root)],
binaries=[],
datas=datas,
hiddenimports=hiddenimports,
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
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,
a.binaries if is_onefile else [],
a.zipfiles if is_onefile else [],
a.datas if is_onefile else [],
exclude_binaries=not is_onefile,
name=app_name,
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=False,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon=str(windows_icon) if is_windows and windows_icon.exists() else None,
)
if is_onefile:
coll = exe
else:
coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=False,
upx_exclude=[],
name=app_name,
)
if is_macos:
app = BUNDLE(
coll,
name=f"{app_name}.app",
icon=str(macos_icon) if macos_icon.exists() else None,
bundle_identifier="com.maoleio.cpacodexmanager",
info_plist={
"CFBundleName": app_name,
"CFBundleDisplayName": app_name,
"CFBundleExecutable": app_name,
"CFBundleShortVersionString": "1.0.0",
"CFBundleVersion": "1.0.0",
"LSMinimumSystemVersion": "11.0",
},
)
else:
app = coll