forked from zealgoswami-lab/skillreducer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_binary.py
More file actions
37 lines (29 loc) · 976 Bytes
/
Copy pathbuild_binary.py
File metadata and controls
37 lines (29 loc) · 976 Bytes
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
#!/usr/bin/env python3
"""Build standalone skillreducer binary with PyInstaller."""
from __future__ import annotations
import shutil
import subprocess
import sys
from pathlib import Path
def main() -> None:
root = Path(__file__).resolve().parent
spec = root / "skillreducer.spec"
dist = root / "dist"
build = root / "build"
print("Building skillreducer binary...")
subprocess.run(
[sys.executable, "-m", "PyInstaller", "--clean", "--noconfirm", str(spec)],
check=True,
cwd=root,
)
binary = dist / ("skillreducer.exe" if sys.platform == "win32" else "skillreducer")
if binary.exists():
print(f"\nBinary ready: {binary}")
print("\nUsage:")
print(f" {binary} audit path/to/skill")
print(f" {binary} agent path/to/skill")
else:
print("Build finished but binary not found at expected path.", file=sys.stderr)
sys.exit(1)
if __name__ == "__main__":
main()