Refactor tagging: create functions, better logs and names, textwrap.dedent (#2239)

This commit is contained in:
Ayaz Salikhov
2025-02-23 20:41:04 +00:00
committed by GitHub
parent 6c47a89558
commit 123d215128
8 changed files with 126 additions and 89 deletions

View File

@@ -1,5 +1,7 @@
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import textwrap
from docker.models.containers import Container
from tagging.utils.docker_runner import DockerRunner
@@ -14,9 +16,11 @@ def quoted_output(container: Container, cmd: str) -> str:
assert cmd_output, f"Command `{cmd}` returned empty output"
return f"""\
`{cmd}`:
return textwrap.dedent(
f"""\
`{cmd}`:
```text
{cmd_output}
```"""
```text
{cmd_output}
```"""
)