#!/usr/bin/env python3
"""Prepare the checkout's environment and generated modules."""

import subprocess
import sys
from pathlib import Path


def main() -> None:
    repository_root = Path(__file__).resolve().parents[1]
    subprocess.run([sys.executable, str(repository_root / 'tools/setup-venv')],
                   cwd=repository_root, check=True)
    python = repository_root / 'venv/bin/python'
    subprocess.run([str(python), '-m', 'tools.generation'], cwd=repository_root, check=True)


if __name__ == '__main__':
    main()
