Index: version.py =================================================================== diff -u -ra38adf9aa031c52a18f21b74f91b42bbbfafb794 -r5818c70699fbe02a31d136f440baee0d9f2cb39d --- version.py (.../version.py) (revision a38adf9aa031c52a18f21b74f91b42bbbfafb794) +++ version.py (.../version.py) (revision 5818c70699fbe02a31d136f440baee0d9f2cb39d) @@ -1,42 +1 @@ -########################################################################### -# -# Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. -# -# THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN -# WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. -# -# @file version.py -# -# @date 16-Jun-2020 -# @author P. Lucia -# -# @brief This file contains the Dialin API version -# -############################################################################ -import subprocess - - -def get_branch(): - """ - Gets the current branch name in the current git repository - - @return: The current branch name - """ - - return subprocess.check_output("git rev-parse --abbrev-ref HEAD", shell=True).decode("utf-8").strip() - - -def get_last_commit(): - """ - Gets the latest commit in the current git repository - - @return: (str) the latest commit in the current git repository - """ - return subprocess.check_output("git rev-parse --short=7 HEAD", shell=True).decode("utf-8").strip() - - -VERSION = "0.1.1-{0}-{1}".format(get_branch(), get_last_commit()) - - -if __name__ == '__main__': - print(VERSION) +dialin/version.py \ No newline at end of file