OmniSciDB  94e8789169
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
version.py
Go to the documentation of this file.
2  import os
3  d = dict(MAJOR='5', MINOR='6', MICRO='0', EXTRA='none')
4  here = os.path.abspath(os.path.dirname(__file__))
5  try:
6  f = open(os.path.join(here, '..', '..', 'CMakeLists.txt'))
7  except FileNotFoundError:
8  return None
9  for line in f.readlines():
10  if line.lstrip().startswith('set(MAPD_VERSION_'):
11  k = line.split()[0].rsplit('_', 1)[-1]
12  n = line.split('"')[1]
13  d[k] = n
14  return '{MAJOR}.{MINOR}.{MICRO}{EXTRA}'.format(**d)
15 
16 
18  from pkg_resources import get_distribution, DistributionNotFound
19  try:
20  return get_distribution(__name__).version
21  except DistributionNotFound:
22  # package is not installed
23  return get_source_version()
int open(const char *path, int flags, int mode)
Definition: omnisci_fs.cpp:64
def get_source_version
Definition: version.py:1
def get_package_version
Definition: version.py:17