Skip to content
ocx
install

PackageCommands (8 of 16)

PackageCommandsclassdataclass#

Re-exported from ocx_sdk._clientView source

createmethod#

def create(path: str | Path, *, identifier: str | None = None, platform: str | None = None, output: str | Path | None = None, metadata: str | Path | None = None, force: bool = False, compression_level: Literal['fast', 'best', 'default'] | None = None, threads: int | None = None, bin_scan: bool | None = None, libc_lint: bool = True, timeout: MaybeTimeout = UNSET, retry: MaybeRetry = UNSET) -> None

Bundle a local directory into a package archive.

Writes the bundle, a compiled metadata sidecar when metadata is given, and a build receipt that push and test read back. There is nothing to return: ocx prints no payload for this command.

Parameters

NameTypeDefaultDescription
pathstr | PathrequiredThe package directory to bundle.
identifierstr | NoneNoneThe identifier the bundle will be published under. Recorded in the receipt, where push finds it.
platformstr | NoneNoneThe platform the content runs on. Required whenever metadata is given.
outputstr | Path | NoneNoneThe output file or directory.
metadatastr | Path | NoneNoneA metadata.json to validate, resolve, and write beside the bundle.
forceboolFalseOverwrite an existing output file.
compression_levelLiteral['fast', 'best', 'default'] | NoneNoneHow hard to compress the bundle. None leaves ocx’s own default.
threadsint | NoneNoneCompression threads. 0 auto-detects, 1 is single-threaded; None leaves ocx’s own default.
bin_scanbool | NoneNoneScan the content tree for the executables the package puts on PATH, verifying a declared binaries claim or filling an absent one. Needs metadata. None leaves ocx’s own default, which fills an absent claim.
libc_lintboolTrueCheck the packaged binaries against the platform’s declared os.features. False is an escape hatch, not a convenience: it publishes a package that may not run on hosts the declaration claims.
timeoutMaybeTimeoutUNSETSeconds per attempt. Omitted takes the config’s.
retryMaybeRetryUNSETRetry policy. None opts out; omitted takes the config’s.

envmethod#

def env(*refs: PackageLike, platform: str | None = None, env: Mapping[str, EnvValue] | None = None, resolve: Resolve | None = None, private: bool = False, lazy_mode: LazyMode | None = None, show_patches: bool = False, timeout: MaybeTimeout = UNSET, retry: MaybeRetry = UNSET) -> EnvReport

Report the environment a set of packages composes.

Returns the same envelope as the project-tier env, and carries the same host snapshot for a hermetic compose().

Parameters

NameTypeDefaultDescription
*refsPackageLike()Package identifiers.
platformstr | NoneNoneThe platform to resolve against.
envMapping[str, EnvValue] | NoneNoneExtra [env] entries for this call.
resolveResolve | NoneNoneWhich store symlink to resolve through — 'candidate' or 'current'. None leaves the choice to ocx. One value, not two booleans: ocx’s --candidate and --current name one link each, so a pair of flags could ask for both.
privateboolFalseCompose the private surface instead of the interface one — ocx’s --self.
lazy_modeLazyMode | NoneNoneWhen content downloads — now, or on first use.
show_patchesboolFalseInclude patch-contributed entries.
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 full envelope.