yera.config.loaders.hubs

Hub connections loader — reads, resolves, and validates hub config.

Symbols

def get_hub_connection — Look up *name* in hub config and validate the entry.
def load_hub_config — Read ``[hubs]`` from yera.toml and build a ``HubConfig`` instance.
def resolve_hub — Determine the effective hub name using the resolution order.

get_hub_connection

get_hub_connection(
    name: str,
    hub_config: HubConfig,
) → HubConnection

Look up name in hub config and validate the entry.

Raises :class:HubNotFoundInConfigError if the name is absent, or :class:HubInvalidConfigError if HubConnection validation fails for the raw entry.

load_hub_config

load_hub_config() → HubConfig

Read [hubs] from yera.toml and build a HubConfig instance.

Separates the default key from named hub entries. Returns an empty HubConfig when the section or file is absent. Construction is infallible with respect to hub entry data — individual entries are stored as raw dicts and validated lazily in :func:get_hub_connection.

resolve_hub

resolve_hub(
    hub_override: str | None,
    hub_config: HubConfig,
    pyproject_hub: str | None,
) → str

Determine the effective hub name using the resolution order.

Priority: CLI --hub override → pyproject.toml hub → HubConfig.default → raise.