Files
tensors/build.py
T
Adam Ladachowski eeb55b2540 💬 Commit message: Update 2026-01-24 19:22:34, 7 files, 1285 lines
📁 Files changed: 7
📝 Lines changed: 1285

  • build.py
  • check.py
  • civit.md
  • main.py
  • pyproject.toml
  • sft_get.py
  • uv.lock
2026-01-24 19:22:34 +01:00

40 lines
946 B
Python

#!/usr/bin/env python3
"""Build script for creating a standalone binary with Nuitka."""
import subprocess
import sys
from pathlib import Path
def main():
project_dir = Path(__file__).parent
main_file = project_dir / "sft_get.py"
output_dir = project_dir / "dist"
output_dir.mkdir(exist_ok=True)
cmd = [
sys.executable,
"-m",
"nuitka",
"--standalone",
"--onefile",
f"--output-dir={output_dir}",
"--output-filename=sft-get",
"--assume-yes-for-downloads",
"--remove-output",
# Include required packages
"--include-package=rich",
"--include-package=httpx",
"--include-package=safetensors",
str(main_file),
]
print(f"Building with command:\n{' '.join(cmd)}\n")
subprocess.run(cmd, check=True)
print(f"\nBuild complete! Binary at: {output_dir / 'sft-get'}")
if __name__ == "__main__":
main()