Index: dialin/__init__.py =================================================================== diff -u -r8c39fe1f9affe360ee6a97c5e6243e58a5c27509 -rc6c42e21248dd7f4bf391b75541aaaae14a1ab42 --- dialin/__init__.py (.../__init__.py) (revision 8c39fe1f9affe360ee6a97c5e6243e58a5c27509) +++ dialin/__init__.py (.../__init__.py) (revision c6c42e21248dd7f4bf391b75541aaaae14a1ab42) @@ -1 +1,5 @@ +import sys +sys.path.append("..") +from version import VERSION + +__version__= VERSION \ No newline at end of file Index: docs/source/conf.py =================================================================== diff -u -rc6596d42d995bed3789849bd85c83da5a3837fac -rc6c42e21248dd7f4bf391b75541aaaae14a1ab42 --- docs/source/conf.py (.../conf.py) (revision c6596d42d995bed3789849bd85c83da5a3837fac) +++ docs/source/conf.py (.../conf.py) (revision c6c42e21248dd7f4bf391b75541aaaae14a1ab42) @@ -20,6 +20,7 @@ import os import sys sys.path.insert(0, os.path.abspath('../../')) +from version import VERSION # -- General configuration ------------------------------------------------ @@ -49,17 +50,17 @@ # General information about the project. project = 'Dialin' -copyright = '2020, Peter Lucia' +copyright = '2020, Diality Inc.' author = 'Peter Lucia' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. -version = '0.1.0' +version = VERSION # The full version, including alpha/beta/rc tags. -release = '0.1.0' +release = VERSION # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. Index: setup.py =================================================================== diff -u -r5d968d07528662da0a93f805142911a874b0fd5c -rc6c42e21248dd7f4bf391b75541aaaae14a1ab42 --- setup.py (.../setup.py) (revision 5d968d07528662da0a93f805142911a874b0fd5c) +++ setup.py (.../setup.py) (revision c6c42e21248dd7f4bf391b75541aaaae14a1ab42) @@ -14,10 +14,11 @@ # ############################################################################ import setuptools +from version import VERSION setuptools.setup( name="dialin", - version="0.1.1", + version=VERSION, author="Peter Lucia", author_email="plucia@diality.com", description="The Diality Dial-In API", Index: tests/test_demo.py =================================================================== diff -u -r84a2eda208d7b18754a8fc101fdb8fd6ab8f4150 -rc6c42e21248dd7f4bf391b75541aaaae14a1ab42 --- tests/test_demo.py (.../test_demo.py) (revision 84a2eda208d7b18754a8fc101fdb8fd6ab8f4150) +++ tests/test_demo.py (.../test_demo.py) (revision c6c42e21248dd7f4bf391b75541aaaae14a1ab42) @@ -89,6 +89,10 @@ hd.bloodflow.cmd_blood_flow_set_point_override(0, NO_RESET) +def test_dialin_version(): + import dialin + print(dialin.__version__) + + if __name__ == '__main__': - test_hd_version() - test_dg_version() + test_dialin_version() Index: version.py =================================================================== diff -u --- version.py (revision 0) +++ version.py (revision c6c42e21248dd7f4bf391b75541aaaae14a1ab42) @@ -0,0 +1,31 @@ +########################################################################### +# +# 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 DialysateGenerator.py +# +# @date 16-Jun-2020 +# @author P. Lucia +# +# @brief This file contains the Dialin API version +# +############################################################################ +import subprocess + + +def get_branch(): + return subprocess.check_output("git rev-parse --abbrev-ref HEAD", shell=True).decode("utf-8").strip() + + +def get_last_commit(): + 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)