Index: dialin/__init__.py =================================================================== diff -u -rc6c42e21248dd7f4bf391b75541aaaae14a1ab42 -r5818c70699fbe02a31d136f440baee0d9f2cb39d --- dialin/__init__.py (.../__init__.py) (revision c6c42e21248dd7f4bf391b75541aaaae14a1ab42) +++ dialin/__init__.py (.../__init__.py) (revision 5818c70699fbe02a31d136f440baee0d9f2cb39d) @@ -1,5 +1,3 @@ -import sys -sys.path.append("..") -from version import VERSION +from .version import VERSION __version__= VERSION \ No newline at end of file Index: dialin/version.py =================================================================== diff -u --- dialin/version.py (revision 0) +++ dialin/version.py (revision 5818c70699fbe02a31d136f440baee0d9f2cb39d) @@ -0,0 +1,42 @@ +########################################################################### +# +# 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) 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