log.py 文件源码

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

项目:NeuroMobile 作者: AndrewADykman 项目源码 文件源码
def should_warn(current_version, removal_version):
    # Our Significant digits on versions is 2, so remove everything but the
    #   first two places.
    current_version = ".".join(current_version.split(".")[:2])
    removal_version = ".".join(removal_version.split(".")[:2])

    # Our warning threshold is one minor version before removal, so we
    #   decrement the minor version by one
    major, minor = removal_version.split(".")
    minor = str(int(minor) - 1)
    warn_version = ".".join([major, minor])

    # Test if our current_version should be a warn
    return (pkg_resources.parse_version(current_version)
                < pkg_resources.parse_version(warn_version))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号