mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-19 02:17:38 +03:00
config.py: docstring new appversion() and appversion_nobuild()
This commit is contained in:
parent
7a8b1100e9
commit
9444973ebd
13
config.py
13
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
|
||||
'+<string>' in _static_appversion.
|
||||
|
||||
:return: str - App version without any build meta data.
|
||||
"""
|
||||
return str(semantic_version.Version(appversion()).truncate('prerelease'))
|
||||
###########################################################################
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user