-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathsetup_app.py
More file actions
130 lines (112 loc) · 3.6 KB
/
setup_app.py
File metadata and controls
130 lines (112 loc) · 3.6 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
"""py2app configuration for building Coral.app (macOS menu bar app).
Usage:
python setup_app.py py2app
Or use the build script:
scripts/build_macos.sh
"""
import glob
import os
# Prevent setuptools from reading pyproject.toml dependencies, which
# py2app rejects via its "install_requires is no longer supported" check.
# We use a custom Distribution that always reports install_requires as empty.
from setuptools import setup, Distribution as _Distribution
class _Py2appDistribution(_Distribution):
@property
def install_requires(self):
return []
@install_requires.setter
def install_requires(self, value):
pass # ignore any attempts to set it
APP = ["src/coral/tray.py"]
# Build DATA_FILES by appending — no fragile index-based mutation.
DATA_FILES = []
# Static assets (CSS, JS, images, icons)
static_files = (
glob.glob("src/coral/static/*.css")
+ glob.glob("src/coral/static/*.js")
+ glob.glob("src/coral/static/*.png")
+ glob.glob("src/coral/static/*.ico")
)
DATA_FILES.append(("coral/static", static_files))
css_files = glob.glob("src/coral/static/css/*.css")
if css_files:
DATA_FILES.append(("coral/static/css", css_files))
# Templates
DATA_FILES.append(("coral/templates", glob.glob("src/coral/templates/*.html")))
include_files = glob.glob("src/coral/templates/includes/*.html")
if include_files:
DATA_FILES.append(("coral/templates/includes", include_files))
view_files = glob.glob("src/coral/templates/includes/views/*.html")
if view_files:
DATA_FILES.append(("coral/templates/includes/views", view_files))
# Docs and guides
DATA_FILES.append(("coral", ["src/coral/PROTOCOL.md"]))
if os.path.exists("src/coral/messageboard/AGENT_GUIDE.md"):
DATA_FILES.append(("coral/messageboard", ["src/coral/messageboard/AGENT_GUIDE.md"]))
# Bundled themes
theme_files = glob.glob("src/coral/bundled_themes/*.json")
if theme_files:
DATA_FILES.append(("coral/bundled_themes", theme_files))
OPTIONS = {
"argv_emulation": False,
"iconfile": "Coral.icns",
"plist": {
"CFBundleName": "Coral",
"CFBundleDisplayName": "Coral",
"CFBundleIdentifier": "com.coral.dashboard",
"CFBundleVersion": "2.3.1",
"CFBundleShortVersionString": "2.3.1",
"LSUIElement": True, # Menu bar only — no Dock icon
"NSHighResolutionCapable": True,
},
"packages": [
"coral",
"fastapi",
"uvicorn",
"jinja2",
"aiosqlite",
"httpx",
"starlette",
"anyio",
"multipart",
"rumps",
],
"includes": [
"coral.web_server",
"coral.api.live_sessions",
"coral.api.history",
"coral.api.system",
"coral.api.schedule",
"coral.api.webhooks",
"coral.api.tasks",
"coral.api.uploads",
"coral.api.themes",
"coral.store",
"coral.store.sessions",
"coral.store.connection",
"coral.store.git",
"coral.store.tasks",
"coral.store.schedule",
"coral.store.webhooks",
"coral.tools.session_manager",
"coral.tools.tmux_manager",
"coral.tools.log_streamer",
"coral.tools.pulse_detector",
"coral.tools.jsonl_reader",
"coral.tools.cron_parser",
"coral.tools.run_callback",
"coral.tools.utils",
"coral.background_tasks",
"coral.agents",
"coral.messageboard.store",
"coral.messageboard.api",
"coral.messageboard.cli",
],
}
setup(
name="Coral",
app=APP,
data_files=DATA_FILES,
options={"py2app": OPTIONS},
distclass=_Py2appDistribution,
)