From 9444973ebd9202c080ce59cbdcf4799bcd2cf81d Mon Sep 17 00:00:00 2001 From: Athanasius Date: Fri, 26 Mar 2021 10:55:24 +0000 Subject: [PATCH] config.py: docstring new appversion() and appversion_nobuild() --- config.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/config.py b/config.py index a3d30c71..53e7d15c 100644 --- a/config.py +++ b/config.py @@ -126,6 +126,11 @@ def git_shorthash_from_head() -> str: def appversion() -> str: + """ + Determine app version including git short hash if possible. + + :return: str - The augmented app version. + """ if getattr(sys, 'frozen', False): # Running frozen, so we should have a .gitversion file with open(GITVERSION_FILE, 'r', encoding='utf-8') as gitv: @@ -143,6 +148,14 @@ def appversion() -> str: def appversion_nobuild() -> str: + """ + Determine app version without *any* build meta data. + + This will not only strip any added git short hash, but also any trailing + '+' in _static_appversion. + + :return: str - App version without any build meta data. + """ return str(semantic_version.Version(appversion()).truncate('prerelease')) ###########################################################################