简体   繁体   English

是否可以用最旧的依赖项 pip 编译 requirements.txt ?

[英]Is it possible to pip-compile a requirements.txt with the oldest dependencies?

I use pip-compile from pip-tools to create a requirements.txt which has all dependencies (including all transitive ones) which fulfill all requirements and are consistent.我使用 pip pip-tools中的pip-compile创建了一个requirements.txt ,它具有满足所有要求且一致的所有依赖项(包括所有传递的依赖项)。 This is nice for applications which I run via CI/CD.这对于我通过 CI/CD 运行的应用程序来说很好。

For libraries, I think it makes sense to create a requirements.txt which has all of the oldest dependencies.对于库,我认为创建一个包含所有最旧依赖项的requirements.txt是有意义的。 This is what I would like to run the test against, because there it is most likely that I depend on a later version and I might not be aware of it.这就是我想要运行测试的对象,因为我很可能依赖于更高版本并且我可能不知道它。

Does pip-compile support this? pip-compile 支持这个吗?

As far as I know this is not yet possible but I raised a feature request at https://github.com/jazzband/pip-tools/issues/1279 for adding it.据我所知,这还不可能,但我在https://github.com/jazzband/pip-tools/issues/1279提出了添加它的功能请求。

There is a very good use-case for this as I often introduced bugs my mistake by starting to use features that required a dependency version bump.有一个非常好的用例,因为我经常通过开始使用需要依赖版本提升的功能来引入错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM