setup.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:lopocs 作者: Oslandia 项目源码 文件源码
def find_version(*file_paths):
    """
    see https://github.com/pypa/sampleproject/blob/master/setup.py
    """

    with open(os.path.join(here, *file_paths), 'r') as f:
        version_file = f.read()

    # The version line must have the form
    # __version__ = 'ver'
    version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
                              version_file, re.M)
    if version_match:
        return version_match.group(1)
    raise RuntimeError("Unable to find version string. "
                       "Should be at the first line of __init__.py.")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号