"""
Build a lean Dynamics.zip package for the website download button.
"""

from __future__ import annotations

import zipfile
from pathlib import Path


HERE = Path(__file__).resolve().parent
ZIP_PATH = HERE.parent / "Dynamics-demo.zip"
ARC_ROOT = "Dynamics"

INCLUDE_FILES = [
    "README.md",
    "dynamics.py",
    "compute.py",
    "sample.py",
    "draw.py",
    "plot_trajectory.py",
    "examples\\case01\\input\\input.txt",
    "examples\\case01\\input\\coord.txt",
]


def main() -> None:
    with zipfile.ZipFile(ZIP_PATH, "w", compression=zipfile.ZIP_DEFLATED) as archive:
        for relative_name in INCLUDE_FILES:
            path = HERE / relative_name
            archive.write(path, arcname=f"{ARC_ROOT}/{relative_name}")
    print(f"[release] wrote {ZIP_PATH}")


if __name__ == "__main__":
    main()
