-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
128 lines (114 loc) · 3.14 KB
/
setup.py
File metadata and controls
128 lines (114 loc) · 3.14 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
"""Build an Apple Silicon Veery.app bundle with py2app."""
from __future__ import annotations
import sys
from pathlib import Path
from py2app.build_app import py2app as py2app_command
from setuptools import setup
ROOT = Path(__file__).resolve().parent
SRC = ROOT / "src"
sys.path.insert(0, str(SRC))
sys.setrecursionlimit(max(sys.getrecursionlimit(), 20_000))
from veery import __version__ # noqa: E402
APP = ["macos_app.py"]
PYTHON_RESOURCES_DIR = f"lib/python{sys.version_info.major}.{sys.version_info.minor}"
DATA_FILES = [
(PYTHON_RESOURCES_DIR, ["config.yaml"]),
(
f"{PYTHON_RESOURCES_DIR}/jargon",
[path.relative_to(ROOT).as_posix() for path in sorted((ROOT / "jargon").glob("*.yaml"))],
),
(
f"{PYTHON_RESOURCES_DIR}/jargon/community",
[
path.relative_to(ROOT).as_posix()
for path in sorted((ROOT / "jargon" / "community").glob("*.yaml"))
],
),
]
OPTIONS = {
"arch": "arm64",
"argv_emulation": False,
"excludes": [
"IPython",
"llvmlite.tests",
"numba.cuda.tests",
"numba.tests",
"numpy.testing",
"numpy.tests",
"pytest",
"scipy.tests",
"setuptools.tests",
"sympy.plotting",
"sympy.testing",
"Tkinter",
"_tkinter",
"tkinter",
"torch.testing",
"torch.testing._internal",
],
"includes": [
"AppKit",
"Cocoa",
"Foundation",
"Quartz",
"PyObjCTools.AppHelper",
"objc",
"pynput.keyboard",
],
"optimize": 0,
"packages": [
"veery",
"funasr",
"llvmlite",
"mlx_whisper",
"modelscope",
"numba",
"numpy",
"onnxruntime",
"pynput",
"rapidfuzz",
"rumps",
"sounddevice",
"soundfile",
"tiktoken",
"torch",
"torchaudio",
"yaml",
],
"plist": {
"CFBundleDisplayName": "Veery",
"CFBundleIdentifier": "io.github.andyhcwang.veery",
"CFBundleName": "Veery",
"CFBundleShortVersionString": __version__,
"CFBundleVersion": __version__,
"LSMinimumSystemVersion": "14.0",
"LSUIElement": True,
"NSHighResolutionCapable": True,
"NSMicrophoneUsageDescription": (
"Veery needs microphone access to capture speech for on-device dictation."
),
},
"site_packages": True,
"strip": False,
}
class VeeryPy2App(py2app_command):
"""Clear setuptools-style dependency metadata before py2app validates options."""
def collect_recipedict(self):
recipes = super().collect_recipedict()
recipes.pop("tkinter", None)
return recipes
def finalize_options(self):
self.distribution.install_requires = []
super().finalize_options()
setup(
app=APP,
cmdclass={"py2app": VeeryPy2App},
data_files=DATA_FILES,
description="macOS bilingual dictation with domain jargon support",
include_package_data=False,
name="Veery",
options={"py2app": OPTIONS},
package_dir={"": "src"},
packages=["veery"],
version=__version__,
)