Skip to content
ocx
install

Project (3 of 6)

Projectclassdataclass#

Re-exported from ocx_sdk._clientView source

pathattributeinstance attribute#

path: Path

session_configproperty#

session_config: OcxConfig

The OcxConfig this handle spawns under — see Ocx.session_config.

addmethod#

def add(*refs: PackageLike, group: str | None = None, pull: bool | None = None, platform: str | None = None, timeout: MaybeTimeout = UNSET, retry: MaybeRetry = UNSET) -> tuple[ToolRow, ...]

Add tool bindings to ocx.toml.

Parameters

NameTypeDefaultDescription
*refsPackageLike()Identifiers, each optionally prefixed NAME=.
groupstr | NoneNoneThe group to add to. None uses the implicit [tools] table.
pullbool | NoneNoneMaterialize the resolved packages. None leaves the choice to ocx’s own default.
platformstr | NoneNoneThe platform to resolve against, as os/arch[/variant][+feature].
timeoutMaybeTimeoutUNSETSeconds per attempt. Omitted takes the config’s.
retryMaybeRetryUNSETRetry policy. None opts out; omitted takes the config’s.

Returns

tuple[ToolRow, ...]
The lock rows the call wrote.

inspectmethod#

def inspect(*names: str, groups: Iterable[str] = (), platform: str | None = None, env: Mapping[str, EnvValue] | None = None, resolve: bool = False, closure: bool = False, timeout: MaybeTimeout = UNSET, retry: MaybeRetry = UNSET) -> InspectReport

Inspect the toolchain’s bindings and their resolution.

Parameters

NameTypeDefaultDescription
*namesstr()Binding names to inspect. Omitted inspects everything.
groupsIterable[str]()Groups to restrict to.
platformstr | NoneNoneThe platform to resolve against.
envMapping[str, EnvValue] | NoneNoneExtra [env] entries for this call, as KEY[:TYPE[:SEP]]=VALUE flags.
resolveboolFalseAdd the pinned identifier, digest, layers, and the resolution chain.
closureboolFalseAdd the dependency closure, its surface, and any conflicts. Conflicting entrypoints raise DataError with the payload attached to the error’s stderr.
timeoutMaybeTimeoutUNSETSeconds per attempt. Omitted takes the config’s.
retryMaybeRetryUNSETRetry policy. None opts out; omitted takes the config’s.

Returns

InspectReport
The inspected packages and the composed [env] entries.

statusmethod#

def status(timeout: MaybeTimeout = UNSET, retry: MaybeRetry = UNSET) -> StatusReport

Report what ocx.toml and ocx.lock declare, resolving nothing.

A broken or stale lock is payload here, not failure: the call still exits 0 and the state shows up on the report.

Parameters

NameTypeDefaultDescription
timeoutMaybeTimeoutUNSETSeconds per attempt. Omitted takes the config’s.
retryMaybeRetryUNSETRetry policy. None opts out; omitted takes the config’s.

Returns

StatusReport
The declared toolchain and the lock’s state.