Skip to content

version

napt.version

NAPT's own package version.

pyproject.toml is the single source of the version; nothing in the codebase hard-codes it. get_version reads it from the installed distribution metadata and caches the result, so the metadata scan happens at most once per process.

get_version cached

get_version() -> str

Returns the installed NAPT package version.

Reads the version from the installed distribution metadata (sourced from pyproject.toml at install time). The lookup scans installed package metadata, so the result is cached for the life of the process.

Returns:

Type Description
str

Version string, for example "0.9.0".

Source code in napt/version.py
@cache
def get_version() -> str:
    """Returns the installed NAPT package version.

    Reads the version from the installed distribution metadata (sourced
    from ``pyproject.toml`` at install time). The lookup scans installed
    package metadata, so the result is cached for the life of the
    process.

    Returns:
        Version string, for example ``"0.9.0"``.

    """
    return version("napt")