def get_dockerflow_version()

in plugins/version_endpoint.py [0:0]


def get_dockerflow_version() -> dict[str, str | None]:
    """
    Parse Dockerflow style version.json file and return it as a dict.

    version.json is baked in the Docker image at build time in CI.

    """
    project_root = get_project_root()
    version_file = project_root / "version.json"
    if version_file.is_file() and version_file.exists():
        with open(project_root / "version.json") as file:
            version = json.load(file)
    else:
        version = {"build": None, "commit": None, "source": None}
    return version