"""Pack three local files into submission.py; no third-party packages needed."""
from pathlib import Path
import ast
import pprint


def main() -> None:
    root = Path(__file__).resolve().parent
    names = ("shapes.py", "report.py", "main.py")
    files = {}
    for name in names:
        source = (root / name).read_text(encoding="utf-8")
        ast.parse(source, filename=name)
        files[name] = source
    target = root / "submission.py"
    source = "def project_files() -> dict[str, str]:\n    return "
    source += pprint.pformat(files, sort_dicts=False, width=88) + "\n"
    target.write_text(source, encoding="utf-8")
    print("Created submission.py. Paste its contents into w10-module-project.")


if __name__ == "__main__":
    main()
