INNER CODE UNIT · Python

_installed_cli_version

Priivacy-ai/spec-kitty · packages/spec-kitty-services/spec_kitty_services/__init__.py:32

def _installed_cli_version() -> str | None:
    try:
        return importlib.metadata.version(_CLI_DISTRIBUTION)
    except importlib.metadata.PackageNotFoundError:
        return None


def _host_target() -> str | None:
    """This host's service target, from the CLI's own authority (``kernel.service_hosts``)."""
    from kernel.service_hosts import host_target  # lazy: a broken CLI install must not break importing the providers

    target = host_target()
    return None if target is None else target.value


def _pinned_sha256(service: str, target: str) -> str | None:
    """The sha256 the CLI's own pin names for *service* on *target*, or ``None`` when it pins none."""
    from kernel.service_pin import ServiceTarget  # lazy, like _host_target

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…