mirror of
https://github.com/Dasharo/Openness-Score.git
synced 2026-06-13 19:16:16 -07:00
openness_score/openness_score.py: Use gitpython to extract version
Signed-off-by: Pawel Langowski <pawel.langowski@3mdeb.com>
This commit is contained in:
@@ -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"""
|
||||
|
||||
|
||||
|
||||
@@ -3,3 +3,4 @@ sphinx-autobuild
|
||||
sphinx-rtd-theme
|
||||
matplotlib
|
||||
pycodestyle
|
||||
gitpython
|
||||
|
||||
Reference in New Issue
Block a user