datalad_next.runners
Execution of subprocesses
This module provides all relevant components for subprocess execution. The
main work horse is iter_subproc()
, a context
manager that enables interaction with a subprocess in the form of an iterable
for input/output processing. Execution errors are communicated with the
CommandError
exception. In addition, a few
convenience functions are provided to execute Git commands (including
git-annex).
|
Context manager to communicate with a subprocess using iterables |
|
Call Git with no output capture, raises on non-zero exit. |
|
Call Git for any (small) number of lines of output |
|
Call Git for a single line of output |
|
Call Git and report success or failure of the command |
|
|
|
Thrown if a command call fails. |
Low-level tooling from datalad-core
Deprecated since version 1.4: The functionality described here has been deprecated, and the associated imports from datalad-core are scheduled for removal with version 2.0. Use the implementations listed above instead.
Few process execution/management utilities are provided, for generic command execution, and for execution command in the context of a Git repository.
alias of |
|
alias of |
Additional information on the design of the subprocess execution tooling is available from https://docs.datalad.org/design/threaded_runner.html
A standard exception type is used to communicate any process termination with a non-zero exit code
|
Thrown if a command call fails. |
Command output can be processed via "protocol" implementations that are
inspired by asyncio.SubprocessProtocol
.
|
WitlessProtocol that swallows stdout/stderr of a subprocess |
|
WitlessProtocol that captures no subprocess output |
|
WitlessProtocol that only captures and returns stdout of a subprocess |
|
WitlessProtocol that only captures and returns stderr of a subprocess |
|
WitlessProtocol that captures and returns stdout/stderr of a subprocess |