fallback version info form CHANGELOG.md

This commit is contained in:
w-e-w 2023-06-03 13:33:23 +09:00
parent d1bfc86ffc
commit df5a3cbefe
1 changed files with 2 additions and 1 deletions

View File

@ -69,7 +69,8 @@ def git_tag():
return subprocess.check_output([git, "describe", "--tags"], shell=False, encoding='utf8').strip() return subprocess.check_output([git, "describe", "--tags"], shell=False, encoding='utf8').strip()
except Exception: except Exception:
try: try:
changelog_md = pathlib.Path(__file__).parent.parent / "CHANGELOG.md" from pathlib import Path
changelog_md = Path(__file__).parent.parent / "CHANGELOG.md"
with changelog_md.open(encoding="utf-8") as file: with changelog_md.open(encoding="utf-8") as file:
return next((line.strip() for line in file if line.strip()), "<none>") return next((line.strip() for line in file if line.strip()), "<none>")
except Exception: except Exception: