return package version without importing it

def get_package_version():
    """return package version without importing it"""
    base = os.path.abspath(os.path.dirname(__file__))
    with open(os.path.join(base, 'policy', '__init__.py'),
              mode='rt',
              encoding='utf-8') as initf:
        for line in initf:
            m = version.match(line.strip())
            if not m:
                continue
            return m.groups()[0]