prefect.utilities.processutils
Functions
sanitize_subprocess_env
None means “omit this key” for subprocess launch paths. Downstream APIs
like subprocess, anyio.open_process, and os.environ.update(...) all
expect concrete string values.
command_to_string
command_from_string.
command_from_string
open_process
anyio.open_process but with:
- Support for Windows command joining
- Termination of the process on exception during yield
- Forced cleanup of process resources during cancellation
run_process
anyio.run_process but with:
- Use of our
open_processutility to ensure resources are cleaned up - Simple
stream_outputsupport to connect the subprocess to the parent stdout/err - Support for submission with
TaskGroup.startmarking as ‘started’ after the process has been created. When used, the PID is returned to the task status.