Код: Выделить всё
def run_black() -> None:
"""Runs black formatter."""
cmd = ["git diff --cached --name-only --diff-filter=d", "|", "grep -E \\.py$", "|", "xargs", "black --skip-string-normalization"]
subprocess.run(cmd, shell=True, check=True, text=True)
Исполняемый файл sys.exe — /usr/local/bin/python3, однако моя среда Python — /home/dev/opensource/.direnv /python-3.9.20/bin
Подробнее здесь: https://stackoverflow.com/questions/792 ... subprocess
Мобильная версия