-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
116 lines (105 loc) · 2.96 KB
/
Copy pathsetup.py
File metadata and controls
116 lines (105 loc) · 2.96 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
"""
py2app build for astar — FULL standalone mode.
venv/bin/python setup.py py2app
Produces dist/astar.app with Python and every dependency frozen inside: the app
runs on its own — no venv, no project folder, no Terminal. Config (the Groq API
key) is read from ~/.astar/.env.
After building, give it the stable identity (permissions persist across
launches) and install it:
codesign --force --deep --sign - --identifier com.astar.astar dist/astar.app
NOTE: any rebuild changes the code fingerprint, so macOS re-asks the privacy
permissions once per rebuild. Batch changes; rebuild rarely.
"""
import sys
from setuptools import setup
# modulegraph AST-scans every module; deeply nested code (numpy/pydantic) blows
# the default 1000-frame recursion limit during the build.
sys.setrecursionlimit(20000)
APP = ["astar_menubar.py"]
# Copied into the bundle wholesale (no dependency analysis) — the reliable way
# to freeze packages with native extensions and dynamic imports.
PACKAGES = [
"astar",
# speech-to-text stack (native wheels)
"faster_whisper",
"ctranslate2",
"tokenizers",
"huggingface_hub",
"onnxruntime",
"av",
# audio I/O (bundle their vendored dylibs too)
"sounddevice",
"_sounddevice_data",
"soundfile",
"_soundfile_data",
"numpy",
# agent stack (heavy on dynamic imports)
"langchain_core",
"langchain_groq",
"langchain_openai",
"openai",
"tiktoken",
"jiter",
"distro",
"regex",
"ormsgpack",
"xxhash",
"uuid_utils",
"zstandard",
"annotated_types",
"typing_inspection",
"anyio",
"sniffio",
"h11",
"requests_toolbelt",
"langgraph",
"langsmith",
"groq",
"pydantic",
"pydantic_core",
# http + misc
"httpx",
"httpcore",
"certifi",
"requests",
"urllib3",
"charset_normalizer",
"idna",
"yaml",
"orjson",
"tenacity",
"jsonpatch",
"jsonpointer",
"tqdm",
"filelock",
"fsspec",
"dateutil",
"dotenv",
"PIL",
"rumps",
"pynput",
]
OPTIONS = {
"argv_emulation": False,
"iconfile": "astar.icns",
"packages": PACKAGES,
"excludes": ["tkinter", "py2app", "setuptools", "pip", "wheel"],
"plist": {
"CFBundleName": "astar",
"CFBundleDisplayName": "astar",
"CFBundleIdentifier": "com.astar.astar",
"CFBundleVersion": "2.0",
"LSUIElement": True, # menu-bar only, no dock icon
"NSAppSleepDisabled": True, # stop macOS App Nap from throttling speech/timers
# These usage strings are REQUIRED for macOS to let the app request access.
"NSMicrophoneUsageDescription": "astar listens to your voice commands.",
"NSCameraUsageDescription": "astar does not use the camera.",
"NSAppleEventsUsageDescription": "astar controls apps like Calculator and Reminders on your command.",
},
}
setup(
app=APP,
name="astar",
options={"py2app": OPTIONS},
setup_requires=["py2app"],
)