本文介绍了pip会忽略setup.py中的dependency_links的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的setup.py中有dependency_links:

I have dependency_links in my setup.py:

...
dependency_links = ['http://github.com/robot-republic/python-s3/tarball/master.tar.gz#egg=python-s3'],
...

但是它不起作用.但是install_requires可以正常工作.也许还有另一种方法可以根据setup.py的要求设置git repo?

But it doesn't work. However install_requires works fine.Maybe there are another method to set up git repo as required for setup.py?

推荐答案

应该会有所帮助.简而言之,您需要为#egg=python-s3指定版本(或"dev"),使其看起来像#egg=python-s3-1.0.0.

This answer should help. In a nutshell, you need to specify the version (or "dev") for the #egg=python-s3 so it looks like #egg=python-s3-1.0.0.

根据@Cerin的评论进行更新:

Updates based on @Cerin's comment:

  • Pip 1.5.x具有用于启用依赖项链接处理的标志: --process-dependency-links .我没有测试它,因为我同意以下几点.
  • 此讨论似乎表明使用依赖项链接点子是一个坏习惯.尽管此功能已被淘汰,但现在已经不复存在了.私有软件包有一个有效的用例.
  • Pip 1.5.x has a flag to enable dependency-links processing: --process-dependency-links. I haven't tested it because I agree with the point below.
  • This discussion seems to indicate that using dependency-links for pip is a bad practice. Although this feature was enlisted for deprecation, it's not anymore. There's a valid use case for private packages.

这篇关于pip会忽略setup.py中的dependency_links的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 10:33