def get_airflow_version()

in plugins/version_endpoint.py [0:0]


def get_airflow_version() -> dict[str, str | None]:
    """Parse Airflow version from Dockerfile and return it as a dict."""
    project_root = get_project_root()
    dockerfile = project_root / "Dockerfile"
    if dockerfile.is_file() and dockerfile.exists():
        with open(dockerfile) as file:
            content = file.read()
        version = parse_airflow_version(dockerfile_content=content)
    else:
        version = None
    return {"version": version}