Skip to content
ocx
install

Project, PackageCommands

PackageCommandsclassdataclass#

Re-exported from ocx_sdk._clientView source
class PackageCommands(_runner: _Runner)

The ocx package command group — machine tier.

Package operations act on the $OCX_HOME store and its candidate and current symlinks. They take no project path and are CWD-independent by construction; a path appears only where the CLI itself takes one.

Every method is multi-identifier native, mirroring the CLI’s PKG... with one shared resolution.

Projectclassdataclass#

Re-exported from ocx_sdk._clientView source

envmethod#

def env(groups: Iterable[str] = (), platform: str | None = None, env: Mapping[str, EnvValue] | None = None, pull: bool | None = None, lazy_mode: LazyMode | None = None, show_patches: bool = False, pinned: bool | None = None, timeout: MaybeTimeout = UNSET, retry: MaybeRetry = UNSET) -> EnvReport

Report the environment the toolchain composes.

The report carries this handle’s host snapshot, so compose() stays hermetic: a report produced under HostEnv.clean() composes against nothing ambient unless you pass a different base.

Note that ocx’s env command takes no binding names — narrow with groups instead.

Parameters

NameTypeDefaultDescription
groupsIterable[str]()Groups to compose. Omitted composes the default set.
platformstr | NoneNoneThe platform to resolve against.
envMapping[str, EnvValue] | NoneNoneExtra [env] entries for this call.
pullbool | NoneNoneMaterialize missing content first. None leaves the choice to ocx’s own default.
lazy_modeLazyMode | NoneNoneWhen content downloads — now, or on first use.
show_patchesboolFalseInclude patch-contributed entries.
pinnedbool | NoneNoneResolve through the rendered toolchain’s pinned digests rather than following its links — ocx’s --pinned / --no-pinned. None leaves the choice to ocx.toml’s pinned key, then OCX_TOOLCHAIN_PINNED, then ocx’s default of following the links.
timeoutMaybeTimeoutUNSETSeconds per attempt. Omitted takes the config’s.
retryMaybeRetryUNSETRetry policy. None opts out; omitted takes the config’s.

Returns

EnvReport
The typed entries plus the binaries, entrypoints, integrations,
EnvReport
and advisories envelope.

updatemethod#

def update(*names: str, check_only: bool = False, groups: Iterable[str] = (), pull: bool | None = None, platform: str | None = None, timeout: MaybeTimeout = UNSET, retry: MaybeRetry = UNSET) -> tuple[ToolRow, ...] | None

Re-resolve declared tags against the registry.

Parameters

NameTypeDefaultDescription
*namesstr()Binding names to advance; every other pin freezes. Omitted advances the whole file.
check_onlyboolFalseCompare the candidate lock to its predecessor and write nothing — ocx’s --check. A changed pin raises DataError.
groupsIterable[str]()Groups to advance. default is the implicit [tools] table, all expands to every group.
pullbool | NoneNoneMaterialize the resolved packages. None leaves the choice to ocx’s own default.
platformstr | NoneNoneThe platform to resolve against.
timeoutMaybeTimeoutUNSETSeconds per attempt. Omitted takes the config’s.
retryMaybeRetryUNSETRetry policy. None opts out; omitted takes the config’s.

Returns

tuple[ToolRow, ...] | None
The lock rows written, or None under check_only.