upgrade-strategy <upgrade_strategy>
Determines how dependency upgrading should be handled. "eager" - dependencies are upgraded
regardless of whether the currently installed version satisfies the
requirements of the upgraded package(s). "only-if-needed" - are
upgraded only when they do not satisfy the requirements of the
upgraded package(s).
对于选择性依赖项安装,唯一的方法确实是根据您的条件对
requirements.txt
文件进行grep/过滤。但是,几乎没有现成的解决方案可用:如果您有一个virtualenv,只需要将其快速升级到新的要求或版本限制,但如果现有的软件包满足条件,则不需要升级,则可以使用
手册上说:
对于可选依赖项,典型的解决方案是setuptools的extra requirements。例如,我将其用于开发和文档构建需求:
^{pr2}$然后您可以按如下方式安装它,既可以从PyPI/DevPI repos,也可以在本地(作为一个可编辑的库):
您可以使用可选依赖项为“额外模式”定义任何名称。在
相关问题 更多 >
编程相关推荐