Skip to content

Commit 6c47a89

Browse files
committed
Use textwrap.dedent() to create build info
1 parent 92a0291 commit 6c47a89

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

tagging/manifests/build_info.py

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Copyright (c) Jupyter Development Team.
22
# Distributed under the terms of the Modified BSD License.
3+
import textwrap
4+
35
import plumbum
46

57
from tagging.manifests.manifest_interface import MarkdownPiece
@@ -28,18 +30,17 @@ def markdown_piece(config: Config, build_timestamp: str) -> MarkdownPiece:
2830
"{{.Size}}",
2931
]().rstrip()
3032

31-
return MarkdownPiece(
32-
title="## Build Info",
33-
sections=[
34-
f"""\
35-
- Build timestamp: {build_timestamp}
36-
- Docker image: `{config.full_image()}:{commit_hash_tag}`
37-
- Docker image size: {image_size}
38-
- Git commit SHA: [{commit_hash}](https://github.com/{config.repository}/commit/{commit_hash})
39-
- Git commit message:
40-
41-
```text
42-
{commit_message}
43-
```"""
44-
],
33+
build_info = textwrap.dedent(
34+
f"""\
35+
- Build timestamp: {build_timestamp}
36+
- Docker image: `{config.full_image()}:{commit_hash_tag}`
37+
- Docker image size: {image_size}
38+
- Git commit SHA: [{commit_hash}](https://github.com/{config.repository}/commit/{commit_hash})
39+
- Git commit message:
40+
41+
```text
42+
{commit_message}
43+
```"""
4544
)
45+
46+
return MarkdownPiece(title="## Build Info", sections=[build_info])

0 commit comments

Comments
 (0)