- integrations
- Python
- ocx_sdk
Project (4 of 6)
Projectclassdataclass#
Re-exported from
ocx_sdk._clientView sourceinitmethod#
def init(timeout: MaybeTimeout = UNSET, retry: MaybeRetry = UNSET) -> CommandResultCreate a minimal ocx.toml in the project directory.
The one project-tier call that carries no --project: ocx init
takes no flags and writes into the working directory, and naming a
project would ask ocx to resolve the very file the call exists to
create. This runs it with the project’s directory as its cwd
instead, so the file lands where the handle points rather than
wherever the caller happens to be.
Returns the raw result: ocx pins no JSON payload for init, so there
is nothing to type yet.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
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
CommandResult- The exit code and whatever ocx printed.
lockmethod#
def lock(check_only: bool = False, pull: bool | None = None, platform: str | None = None, timeout: MaybeTimeout = UNSET, retry: MaybeRetry = UNSET) -> tuple[ToolRow, ...] | NoneResolve declared tags to digests and write ocx.lock.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
check_only | bool | False | Verify the lock is current and write nothing — ocx’s
--check. Drift raises DataError; a missing lock raises
ConfigError. Named apart from the check= on run, which
is the subprocess.run sense of “raise on a non-zero exit”. |
pull | bool | None | None | Materialize the resolved packages. None leaves the
choice to ocx’s own default. |
platform | str | None | None | The platform to resolve against. |
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
tuple[ToolRow, ...] | None- The lock rows written, or
Noneundercheck_only— ocx reports tuple[ToolRow, ...] | None- a current lock with exit 0 and an empty body.
pullmethod#
def pull(dry_run: bool = False, groups: Iterable[str] = (), platform: str | None = None, lazy_mode: LazyMode | None = None, timeout: MaybeTimeout = UNSET, retry: MaybeRetry = UNSET) -> PullReport | tuple[DryRunEntry, ...]Pre-warm the object store from ocx.lock.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
dry_run | bool | False | Report what would be fetched without writing. Changes
the return type: ocx previews with a different upstream
report at a different JSON root, so this answers a tuple of
DryRunEntry rows rather than a PullReport. |
groups | Iterable[str] | () | Groups to restrict the pull to. |
platform | str | None | None | The platform to resolve against. |
lazy_mode | LazyMode | None | None | When content downloads — now, or on first use. |
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
PullReport | tuple[DryRunEntry, ...]- The materialized paths and any advisories — or, under
dry_run, PullReport | tuple[DryRunEntry, ...]- one row per package describing what a real pull would do.