openness_score/openness_score.py: Use gitpython to extract version

Signed-off-by: Pawel Langowski <pawel.langowski@3mdeb.com>
This commit is contained in:
Pawel Langowski
2025-07-04 12:07:00 +02:00
parent b397209a40
commit cac6d58361
2 changed files with 11 additions and 1 deletions
+10 -1
View File
@@ -10,10 +10,19 @@ import subprocess
from coreboot import DasharoCorebootImage
from uefi import UEFIImage
from argparse import ArgumentParser, RawTextHelpFormatter, SUPPRESS
from git import Repo
"""The Dasharo Openness Score utility's entrypoint"""
version = 'v0.2.0'
script_path = Path(__file__).resolve()
repo_path = script_path.parent.parent
repo = Repo(repo_path)
try:
version = repo.git.describe(tags=True, always=True, dirty=True)
except Exception:
version = "unknown"
"""The utility's version"""
+1
View File
@@ -3,3 +3,4 @@ sphinx-autobuild
sphinx-rtd-theme
matplotlib
pycodestyle
gitpython