setup.py 文件源码

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

项目:ml-utils 作者: LinxiFan 项目源码 文件源码
def get_requires():
    """
    DEPRECATED: dependency_links doesn't work
    Enables both "pytorch>=0.2" and "git+ssh://..." style links to work
    You can list both in requirements.txt, which is not supposed to be the same
    as listing requires in setup.py
    Don't forget to append "#egg=pytorch-0.2" to the end of the github src link
    Turns out that as well as a dependency_links line, we also need to add the
    name of the package in the install_requires line

    https://stackoverflow.com/a/33685899/3453033
    https://mike.zwobble.org/2013/05/adding-git-or-hg-or-svn-dependencies-in-setup-py/
    https://stackoverflow.com/questions/3472430/how-can-i-make-setuptools-install-a-package-thats-not-on-pypi
    https://stackoverflow.com/questions/19738085/why-isnt-setup-py-dependency-links-doing-anything
    """
    reqs = read('requirements.txt').splitlines()
    install_requires = []
    dependency_links = []
    for req in reqs:
        if 'git+' in req or '://' in req:
            dependency_links.append(req)
        else:
            install_requires.append(req)
    return install_requires, dependency_links
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号