def get_version(package):
    """
    Return package version as listed in `__version__` in `init.py`.
    """
    init_py = open(os.path.join(package, "__init__.py")).read()
    return re.search(
        r"^__version__ = ['\"]([^'\"]+)['\"]",
        init_py,
        re.MULTILINE,
    ).group(1)

    Return package version as listed in `__version__` in `init.py`.
    
setup.py