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
评论列表
文章目录