Index: VERSION =================================================================== diff -u --- VERSION (revision 0) +++ VERSION (revision 96528d6af0f0edb14cf4289297efb71bdff499da) @@ -0,0 +1 @@ +1.0.0-000-local \ No newline at end of file Index: leahi_dialin/version.py =================================================================== diff -u -r7ce778dc51b7dba5a7a7ca14244ed7eea7bf029d -r96528d6af0f0edb14cf4289297efb71bdff499da --- leahi_dialin/version.py (.../version.py) (revision 7ce778dc51b7dba5a7a7ca14244ed7eea7bf029d) +++ leahi_dialin/version.py (.../version.py) (revision 96528d6af0f0edb14cf4289297efb71bdff499da) @@ -8,16 +8,19 @@ # @file version.py # # @author (last) Zoltan Miskolci -# @date (last) 04-Dec-2025 +# @date (last) 22-Jun-2026 # @author (original) Peter Lucia # @date (original) 22-Jun-2021 # ############################################################################ + +# Module imports import subprocess import os.path +from typing import Tuple -VERSION = "1.0.0" +VERSION_FILE_LOCATION = './VERSION' def get_branch(): """ @@ -68,17 +71,30 @@ return res -branch = None -commit = None +def read_version_file() -> Tuple[str, str, str, str]: + """ + Loads the information from the VERSION file. -DEV_VERSION = VERSION + @return: Version information + """ + version = None + build_num = None + branch = None + commit = None -if check_if_git_repo(): - branch = get_branch() - commit = get_last_commit() - DEV_VERSION += ".{0}".format(branch) - DEV_VERSION += ".{0}".format(commit) + with open(file = os.path.abspath(VERSION_FILE_LOCATION)) as f: + content = f.read().split('-') + version = content[0] + build_num = content[1] + branch = content[2] + if branch == 'local' and check_if_git_repo(): + branch = get_branch() + commit = get_last_commit() + return f'{version}.{build_num}.{branch}.{commit}' + +DEV_VERSION = read_version_file() + if __name__ == '__main__': print(DEV_VERSION) \ No newline at end of file