pip_chill.py 文件源码

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

项目:pip-chill 作者: rbanffy 项目源码 文件源码
def chill(show_all=False):

    if show_all:
        ignored_packages = ()
    else:
        ignored_packages = ('pip', 'pip-chill', 'wheel', 'setuptools',
                            'pkg-resources')

    # Gather all packages that are requirements and will be auto-installed.
    dependencies = set()
    for distribution in pip.get_installed_distributions():
        for requirement in distribution.requires():
            dependencies.add(requirement.key)

    # List all packages and versions installed, excluding the auto-installed.
    return [
        (distribution.key, distribution.version)
        for distribution in pip.get_installed_distributions()
        if distribution.key not in dependencies
        and distribution.key not in ignored_packages
    ]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号