Belle II Software development
version.py
1#!/usr/bin/env python3
2
3
10
11import os
12import basf2
13
14
15def get_version():
16 version = ''
17 try:
18 # Always avoid the top-level 'import ROOT'.
19 import ROOT # noqa
20 ROOT.gSystem.Load('libframework_io')
21 ROOT.gROOT.LoadMacro(basf2.find_file("include/framework/io/RootIOUtilities.h"))
22 version = ROOT.Belle2.RootIOUtilities.getCommitID()
23 except AttributeError:
24 pass
25 return version
26
27
28def get_release():
29 release = (os.environ.get('BELLE2_RELEASE', 'unknown'))
30 return release
31
32
33if __name__ == "__main__":
34 print(f'basf2 (Belle II Analysis Software Framework), Version: {get_version()} (Release: {get_release()})')