diff options
author | Martin Braun <martin.braun@ettus.com> | 2018-03-30 14:19:35 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2018-04-02 15:27:05 -0700 |
commit | a5b87ab7c4a6834acc7587ffc4a769854b9d48b4 (patch) | |
tree | a9c16e82b6556bb5653052f8681e7d267c33085d /mpm/python | |
parent | c7f52870805c9d9f79f15c80e9a4ad53ed88c857 (diff) | |
download | uhd-a5b87ab7c4a6834acc7587ffc4a769854b9d48b4.tar.gz uhd-a5b87ab7c4a6834acc7587ffc4a769854b9d48b4.tar.bz2 uhd-a5b87ab7c4a6834acc7587ffc4a769854b9d48b4.zip |
mpm: cmake: Add git hash and version info to Python module
Reviewed-by: Brent Stapleton <brent.stapleton@ettus.com>
Diffstat (limited to 'mpm/python')
-rwxr-xr-x | mpm/python/usrp_hwd.py | 4 | ||||
-rw-r--r-- | mpm/python/usrp_mpm/__init__.py | 3 | ||||
-rw-r--r-- | mpm/python/usrp_mpm/periph_manager/__init__.py.in | 3 |
3 files changed, 10 insertions, 0 deletions
diff --git a/mpm/python/usrp_hwd.py b/mpm/python/usrp_hwd.py index 0b2cd1ecb..d04d04927 100755 --- a/mpm/python/usrp_hwd.py +++ b/mpm/python/usrp_hwd.py @@ -170,6 +170,10 @@ def main(): log = mpm.get_main_logger( log_default_delta=args.verbose-args.quiet ).getChild('main') + version_string = mpm.__version__ + if len(mpm.__githash__): + version_string += "-g" + mpm.__githash__ + log.info("Launching USRP/MPM, version: %s", version_string) if args.override_db_pids is not None: log.warning('Overriding daughterboard PIDs!') args.default_args['override_db_pids'] = args.override_db_pids diff --git a/mpm/python/usrp_mpm/__init__.py b/mpm/python/usrp_mpm/__init__.py index 00cbcc987..6b6b86d08 100644 --- a/mpm/python/usrp_mpm/__init__.py +++ b/mpm/python/usrp_mpm/__init__.py @@ -18,3 +18,6 @@ from . import cores from . import chips from . import gpsd_iface from .mpmlog import get_main_logger + +__version__ = periph_manager.__version__ +__githash__ = periph_manager.__githash__ diff --git a/mpm/python/usrp_mpm/periph_manager/__init__.py.in b/mpm/python/usrp_mpm/periph_manager/__init__.py.in index f507a6808..1a84ca3a4 100644 --- a/mpm/python/usrp_mpm/periph_manager/__init__.py.in +++ b/mpm/python/usrp_mpm/periph_manager/__init__.py.in @@ -7,6 +7,9 @@ periph_manager __init__.py """ +__version__ = "${MPM_VERSION_MAJOR}.${MPM_VERSION_API}.${MPM_VERSION_ABI}.${MPM_VERSION_PATCH}" +__githash__ = "${MPM_GIT_HASH_RAW}" + from .base import PeriphManagerBase # This is where the import magic happens |