tool_run
tool_run
#
run_tool — subprocess.run for a recipe: the child's output streams into exec.log.
Both of the child's streams are pumped, as they arrive, into the ambient
workspace's exec.log (see exec_log); only a capturing caller's streams
are also buffered. Outside any workspace the call is a plain subprocess.run.
run_tool(owner, argv, *, cwd, env, timeout, check, capture_output)
#
Run argv in cwd the way subprocess.run does, logging for owner.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
object
|
The value running the tool; its workspace decides where the log is. |
required |
argv
|
Sequence[str | PathLike[str]]
|
The command line. |
required |
cwd
|
PathLike[str]
|
The working directory. |
required |
env
|
Mapping[str, str] | None
|
The child's environment, or the parent's when |
required |
timeout
|
float | None
|
Seconds before the child is killed. |
required |
check
|
bool
|
Whether a non-zero exit raises. |
required |
capture_output
|
bool
|
Whether stdout and stderr come back on the result. |
required |
Raises:
| Type | Description |
|---|---|
CalledProcessError
|
If |
TimeoutExpired
|
If the child outlives |