mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-18 07:22:57 +00:00
Add command which was run to the markdown piece
This commit is contained in:
@@ -108,12 +108,14 @@ from tagging.manifests import ManifestInterface, quoted_output
|
||||
class AptPackagesManifest(ManifestInterface):
|
||||
@staticmethod
|
||||
def markdown_piece(container) -> str:
|
||||
return "\n".join(
|
||||
["## Apt Packages", "", quoted_output(container, "apt list --installed")]
|
||||
)
|
||||
return f"""\
|
||||
## Apt Packages
|
||||
|
||||
{quoted_output(container, "apt list --installed")}"""
|
||||
```
|
||||
|
||||
- `quoted_output` simply runs the command inside a container using `DockerRunner.run_simple_command` and wraps it to triple quotes to create a valid markdown piece.
|
||||
It also adds the command which was run to the markdown piece.
|
||||
- `manifests.py` contains all the manifests.
|
||||
- `write_manifest.py` is a python executable which is used to create the build manifest and history line for an image.
|
||||
|
||||
|
@@ -16,6 +16,8 @@ def quoted_output(container: Container, cmd: str) -> str:
|
||||
# For example, R packages list contains trailing backspaces
|
||||
cmd_output = "\n".join(line.rstrip() for line in cmd_output.split("\n"))
|
||||
return f"""\
|
||||
`{cmd}`:
|
||||
|
||||
```text
|
||||
{cmd_output}
|
||||
```"""
|
||||
@@ -74,12 +76,8 @@ class CondaEnvironmentManifest(ManifestInterface):
|
||||
|
||||
{DockerRunner.run_simple_command(container, "python --version")}
|
||||
|
||||
`mamba info --quiet`:
|
||||
|
||||
{quoted_output(container, "mamba info --quiet")}
|
||||
|
||||
`mamba list`:
|
||||
|
||||
{quoted_output(container, "mamba list")}"""
|
||||
|
||||
|
||||
@@ -89,8 +87,6 @@ class AptPackagesManifest(ManifestInterface):
|
||||
return f"""\
|
||||
## Apt Packages
|
||||
|
||||
`apt list --installed`:
|
||||
|
||||
{quoted_output(container, "apt list --installed")}"""
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user