yera.cli.context
CLI application context passed to every command.
Symbols
AppContext
Container passed to every CLI command as ctx.
settings is always populated (may be None when validation failed
and the command tolerates it). hub_config and pyproject_hub
are only populated when the command declares
@requires(AppResource.HUB_CONFIG); accessing them without that
declaration raises :class:RuntimeError.
credential_store and active_credential_group are only populated when the
command declares @requires(AppResource.CREDENTIALS); accessing them
without that declaration raises :class:RuntimeError.
Methods
AppContext.set_hub_data
set_hub_data(
hub_config: HubConfig,
pyproject_hub: str | None,
) → NonePopulate hub config and the pyproject hub override atomically.
AppContext.set_credentials_data
set_credentials_data(
credential_store: CredentialStore,
active_credential_group: ResolvedCredentialGroup | None,
) → NonePopulate credential store and active credential group atomically.
AppContext.require_active_credential_group
require_active_credential_group() → ResolvedCredentialGroupReturn the resolved active credential group or raise CredentialGroupNotSpecifiedError.
AppContext.set_provider_data
set_provider_data(
providers: Providers,
) → NonePopulate provider config.
AppContext.set_profile_data
set_profile_data(
profiles: Profiles | None,
) → NoneSet the profile data in context.
AppContext.set_models_universe
set_models_universe(
models: ModelsUniverse | None,
) → NoneSet the model data in context.