Index: tests/test_imports.py =================================================================== diff -u -r028952270169971af5075574ba7b7b4ba241acd3 -ra38adf9aa031c52a18f21b74f91b42bbbfafb794 --- tests/test_imports.py (.../test_imports.py) (revision 028952270169971af5075574ba7b7b4ba241acd3) +++ tests/test_imports.py (.../test_imports.py) (revision a38adf9aa031c52a18f21b74f91b42bbbfafb794) @@ -60,6 +60,12 @@ from dialin.utils.conversions import (integer_to_bytearray, float_to_bytearray) + # @unittest.skip("Skipping test_imports") + def test_api_version(self): + import dialin + print(dialin.__version__) + + if __name__ == '__main__': unittest.main(verbosity=2) Index: version.py =================================================================== diff -u -rc6c42e21248dd7f4bf391b75541aaaae14a1ab42 -ra38adf9aa031c52a18f21b74f91b42bbbfafb794 --- version.py (.../version.py) (revision c6c42e21248dd7f4bf391b75541aaaae14a1ab42) +++ version.py (.../version.py) (revision a38adf9aa031c52a18f21b74f91b42bbbfafb794) @@ -5,7 +5,7 @@ # 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 DialysateGenerator.py +# @file version.py # # @date 16-Jun-2020 # @author P. Lucia @@ -17,10 +17,21 @@ 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()