nmk.utils ========= .. py:module:: nmk.utils Functions --------- .. autoapisummary:: nmk.utils.run_with_logs nmk.utils.run_pip nmk.utils.is_windows nmk.utils.create_dir_symlink nmk.utils.is_condition_set Module Contents --------------- .. py:function:: run_with_logs(args: list[str], logger=NmkLogger, check: bool = True, cwd: pathlib.Path = None) -> subprocess.CompletedProcess Execute subprocess, and logs output/error streams + error code :param args: subprocess commands and arguments :param logger: logger instance :param check: if True and subprocess return code is not 0, raise an exception :param cwd: current working directory for subprocess :return: completed process instance .. py:function:: run_pip(args: list[str], logger=NmkLogger, extra_args: str = '') -> str Execute pip command, with logging :param args: pip command arguments :param logger: logger instance :param extra_args: extra arguments (split on spaces and passed to pip command) :return: executed pip command stdout .. py:function:: is_windows() -> bool Returns true if running on Windows, false otherwise .. py:function:: create_dir_symlink(target: pathlib.Path, link: pathlib.Path) Create a directory symbolic link (or something close, according to the OS) :param target: path that will be pointed by the created link :param link: created link location .. py:function:: is_condition_set(value: Union[list, dict, str, bool, int]) -> bool Verify if task condition is considered to be "true", depending on provided value :param value: value to be evaluated