- integrations
- Python
- ocx_sdk
PackageCommands (8 of 16)
PackageCommandsclassdataclass#
Re-exported from
ocx_sdk._clientView sourcecreatemethod#
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) -> NoneBundle 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
| Name | Type | Default | Description |
|---|---|---|---|
path | str | Path | required | The package directory to bundle. |
identifier | str | None | None | The identifier the bundle will be published under.
Recorded in the receipt, where push finds it. |
platform | str | None | None | The platform the content runs on. Required whenever
metadata is given. |
output | str | Path | None | None | The output file or directory. |
metadata | str | Path | None | None | A metadata.json to validate, resolve, and write
beside the bundle. |
force | bool | False | Overwrite an existing output file. |
compression_level | Literal['fast', 'best', 'default'] | None | None | How hard to compress the bundle. None
leaves ocx’s own default. |
threads | int | None | None | Compression threads. 0 auto-detects, 1 is
single-threaded; None leaves ocx’s own default. |
bin_scan | bool | None | None | Scan 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_lint | bool | True | Check 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. |
timeout | MaybeTimeout | UNSET | Seconds per attempt. Omitted takes the config’s. |
retry | MaybeRetry | UNSET | Retry 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) -> EnvReportReport 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
| Name | Type | Default | Description |
|---|---|---|---|
*refs | PackageLike | () | Package identifiers. |
platform | str | None | None | The platform to resolve against. |
env | Mapping[str, EnvValue] | None | None | Extra [env] entries for this call. |
resolve | Resolve | None | None | Which 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. |
private | bool | False | Compose the private surface instead of the interface
one — ocx’s --self. |
lazy_mode | LazyMode | None | None | When content downloads — now, or on first use. |
show_patches | bool | False | Include patch-contributed entries. |
timeout | MaybeTimeout | UNSET | Seconds per attempt. Omitted takes the config’s. |
retry | MaybeRetry | UNSET | Retry policy. None opts out; omitted takes the config’s. |
Returns
EnvReport- The typed entries plus the full envelope.