- integrations
- Python
- ocx_sdk
Project (5 of 6)
Projectclassdataclass#
Re-exported from
ocx_sdk._clientView sourceexec_asyncmethodasync#
async def exec_async(argv: Sequence[str], *, names: Iterable[str] = (), groups: Iterable[str] = (), clean: bool = False, env: Mapping[str, EnvValue] | None = None, lazy_mode: LazyMode | None = None, pinned: bool | None = None, records_dir: str | Path | None = None, records_name: str | None = None, capture: bool = True, check: bool = True, timeout: MaybeTimeout = UNSET) -> CommandResultRun a command in the project’s environment, on the event loop.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
argv | Sequence[str] | required | The command and its arguments. Must not be empty. |
names | Iterable[str] | () | Bindings to compose. |
groups | Iterable[str] | () | Groups to compose. |
clean | bool | False | Strip the ambient parent environment before composing. |
env | Mapping[str, EnvValue] | None | None | Extra [env] entries for this call. |
lazy_mode | LazyMode | None | None | When content downloads — now, or on first use. |
pinned | bool | None | None | Resolve through pinned digests — see exec. |
records_dir | str | Path | None | None | Write an execution record here — see exec. |
records_name | str | None | None | The record’s filename template — see exec. |
capture | bool | True | Pipe and capture both streams. |
check | bool | True | Raise on a non-zero child exit instead of returning it. |
timeout | MaybeTimeout | UNSET | Seconds for the whole run. Omitted takes the config’s. |
Returns
CommandResult- The child’s exit code and, under
capture, its output.
Raises
ValueErrorargvis empty, or the handle carries anon_logcallback, which v0.1 refuses on async paths.OcxProcessError- The child exited non-zero under
check. OcxTimeoutError- The timeout expired.
spawnmethod#
def spawn(argv: Sequence[str], *, names: Iterable[str] = (), groups: Iterable[str] = (), clean: bool = False, env: Mapping[str, EnvValue] | None = None, lazy_mode: LazyMode | None = None, pinned: bool | None = None, records_dir: str | Path | None = None, records_name: str | None = None, **popen_kw: Any) -> subprocess.Popen[Any]Start a command in the project’s environment and return Popen.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
argv | Sequence[str] | required | The command and its arguments. Must not be empty. |
names | Iterable[str] | () | Bindings to compose. |
groups | Iterable[str] | () | Groups to compose. |
clean | bool | False | Strip the ambient parent environment before composing. |
env | Mapping[str, EnvValue] | None | None | Extra [env] entries for this call, not the child’s
environment — that one is SDK-composed. |
lazy_mode | LazyMode | None | None | When content downloads — now, or on first use. |
pinned | bool | None | None | Resolve through pinned digests — see exec. |
records_dir | str | Path | None | None | Write an execution record here — see exec. |
records_name | str | None | None | The record’s filename template — see exec. |
**popen_kw | Any | {} | Forwarded to Popen. args, shell, and
executable are rejected. |
Returns
subprocess.Popen[Any]- The running child.
Raises
ValueErrorargvis empty, or a rejected keyword was passed.