import subprocess def latexmk(args: dict, deps, output): compile_process = subprocess.Popen( ["latexmk", deps[0]], stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True ) yield from compile_process.stderr