Skip to content
ocx
install

PackageCommands (5 of 16)

PackageCommandsclassdataclass#

Re-exported from ocx_sdk._clientView source

description_pushmethod#

def description_push(identifier: PackageLike, *, from_: PackageLike | None = None, readme: str | Path | None = None, logo: str | Path | None = None, title: str | None = None, description: str | None = None, keywords: str | None = None, timeout: MaybeTimeout = UNSET, retry: MaybeRetry = UNSET) -> CommandResult

Publish description metadata for a package repository (C-003).

ocx prints no JSON payload for this command (D9) — it logs and exits, so there is nothing typed to return.

Parameters

NameTypeDefaultDescription
identifierPackageLikerequiredThe package repository to describe.
from_PackageLike | NoneNoneAnother package to copy the description from, instead of the field arguments below — ocx’s --from takes a package identifier, not a path (package_description_push.rs:26-27). Mutually exclusive with readme, logo, title, description, and keywords.
readmestr | Path | NoneNoneThe README file to publish.
logostr | Path | NoneNoneThe logo file to publish.
titlestr | NoneNoneThe display title to publish.
descriptionstr | NoneNoneThe prose description to publish.
keywordsstr | NoneNoneA single delimited keywords string, not a list — ocx’s own field is a bare string (C-021).
timeoutMaybeTimeoutUNSETSeconds per attempt. Omitted takes the config’s.
retryMaybeRetryUNSETRetry policy. Defaults to no retries — this is a registry write (D5).

Returns

CommandResult
The exit code and whatever ocx printed.

Raises

ValueError
Neither from_ nor any of the five field arguments was given, or from_ was given alongside one of them.
NotFoundError
from_ names a source that carries no description (exit 79).

execmethod#

def exec(refs: Sequence[PackageLike], argv: Sequence[str], *, platform: str | None = None, clean: bool = False, private: bool = False, env: Mapping[str, EnvValue] | None = None, lazy_mode: LazyMode | None = None, records_dir: str | Path | None = None, records_name: str | None = None, capture: bool = True, check: bool = True, timeout: MaybeTimeout = UNSET) -> CommandResult

Run a command in a set of packages’ composed environment.

Two positional groups, mirroring the CLI’s PKG... -- CMD.... The child’s exit code comes back byte for byte; child processes are never retried.

Parameters

NameTypeDefaultDescription
refsSequence[PackageLike]requiredPackage identifiers to compose.
argvSequence[str]requiredThe command and its arguments. Must not be empty.
platformstr | NoneNoneThe platform to resolve against.
cleanboolFalseStrip the ambient parent environment before composing.
privateboolFalseCompose the private surface — ocx’s --self.
envMapping[str, EnvValue] | NoneNoneExtra [env] entries for this call.
lazy_modeLazyMode | NoneNoneWhen content downloads — now, or on first use.
records_dirstr | Path | NoneNoneWrite an execution record — the resolved closure and executable — under this directory. None leaves it to [records] dir and OCX_RECORDS_DIR; with none of the three, no record is written.
records_namestr | NoneNoneThe record’s filename template, over {time}, {host}, {pid} and {rand}. None leaves it to [records] name and OCX_RECORDS_NAME.
captureboolTruePipe and capture both streams.
checkboolTrueRaise on a non-zero child exit instead of returning it.
timeoutMaybeTimeoutUNSETSeconds for the whole run. Omitted takes the config’s.

Returns

CommandResult
The child’s exit code and, under capture, its output.

Raises

ValueError
argv is empty.
OcxProcessError
The child exited non-zero under check.
OcxTimeoutError
The timeout expired.