Skip to content

Commit 179cd5e

Browse files
committed
Add current commit details to About dialog
1 parent e98cc79 commit 179cd5e

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

conda_metadata_app/app_config.py

+18
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import os
88
from collections.abc import Iterable
99
from enum import StrEnum
10+
from subprocess import CalledProcessError, check_output
1011
from typing import Literal, Self
1112

1213
from pydantic import (
@@ -427,5 +428,22 @@ def export_json_schema() -> None:
427428
f.write("\n")
428429

429430

431+
def app_version() -> str:
432+
try:
433+
return check_output(
434+
[
435+
"git",
436+
"--no-pager",
437+
"log",
438+
"-1",
439+
"--pretty=format:`%h (%cd)`",
440+
"--date=format:%Y-%m-%d %H:%M:%S",
441+
],
442+
text=True,
443+
).strip()
444+
except CalledProcessError:
445+
return ""
446+
447+
430448
if __name__ == "__main__":
431449
export_json_schema()

conda_metadata_app/pages/main_page.py

+10
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
MetadataRetrieval,
3535
PackageDiscoveryChoice,
3636
Secret,
37+
app_version,
3738
)
3839
from conda_metadata_app.version_order import VersionOrder
3940

@@ -62,10 +63,19 @@
6263
yaml.allow_duplicate_keys = True
6364
yaml.default_flow_style = False
6465
logger = get_logger(__name__)
66+
67+
6568
st.set_page_config(
6669
page_title="conda metadata browser",
6770
page_icon="📦",
6871
initial_sidebar_state="expanded",
72+
menu_items={
73+
"about": f"""
74+
**📦 conda-metadata-app `{app_version()}`**
75+
76+
Browse metadata from conda packages in conda-forge, bioconda and others.
77+
"""
78+
},
6979
)
7080

7181
EXTENSION_TO_CATEGORY = {

0 commit comments

Comments
 (0)