def _get_version():
  with open('hdfs/__init__.py') as reader:
    match = re.search(
      r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
      reader.read(),
      re.MULTILINE
    )
    if match:
      return match.group(1)
    else:
      raise RuntimeError('Unable to extract version.')
Extract version from package.
dataset/ETHPy150Open mtth/hdfs/setup.py/_get_version