-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild_macos.py
More file actions
45 lines (36 loc) · 1.08 KB
/
build_macos.py
File metadata and controls
45 lines (36 loc) · 1.08 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
#!/usr/bin/env python3
"""Helper for building the macOS bundle with PyInstaller."""
import os
from pathlib import Path
import PyInstaller.__main__
ARGS = [
"app/__init__.py",
"--name=Glimpser",
"--onefile",
"--windowed",
"--add-data=app/templates:templates",
"--add-data=app/static:static",
"--hidden-import=flask",
"--hidden-import=flask_apscheduler",
"--hidden-import=sqlalchemy",
"--hidden-import=werkzeug",
"--hidden-import=jinja2",
"--hidden-import=PIL",
"--hidden-import=numpy",
"--hidden-import=selenium",
"--hidden-import=undetected_chromedriver",
"--hidden-import=yt_dlp",
"--hidden-import=pdf2image",
"--hidden-import=pyvirtualdisplay",
"--exclude-module=onnxruntime", # Skip optional onnxruntime to speed up build
"--icon=app/static/favicon.ico",
]
def build() -> None:
"""Invoke PyInstaller with macOS settings."""
os.chdir(Path(__file__).resolve().parent)
PyInstaller.__main__.run(ARGS)
def main() -> None:
"""Command-line entry point."""
build()
if __name__ == "__main__":
main()