"""
Provides the epilog for a stub file.
"""

from __future__ import annotations

from pathlib import Path

from .._version import __version__


def epilog(pyx_path: Path | None) -> str:
    """Provides the epilog for a stub file"""
    if pyx_path is not None:
        source_desc = f" from {pyx_path}"
    else:
        source_desc = ""

    return f"# This file was generated by stubgen-pyx v{__version__}{source_desc}\n"
