pip包依赖性问题

2024-10-17 08:33:54 发布

您现在位置:Python中文网/ 问答频道 /正文

以这个为例:https://github.com/bitprophet/fabric/blob/master/setup.py#L41

所以Fabric需要pycrypto>;=1.9和paramiko>;=1.7.6

如果pycrypto将版本更新到2.1,并更改其api,会影响我的包。这不是我想要的结果。在

那么,他们的约定是,包不能更改api,还是可以将我需要的包打包到自己的包中?在


Tags: pyhttpsgtgithubmastercomapiparamiko
1条回答
网友
1楼 · 发布于 2024-10-17 08:33:54

this怎么样?在

节选

So what are requirements files? They are very simple: lists of packages to install. Instead of running something like pip MyApp and getting whatever libraries come along, you can create a requirements file something like:

MyApp
Framework==0.9.4
Library>=0.2

Then, regardless of what MyApp lists in setup.py, you’ll get a specific version of Framework (0.9.4) and at least the 0.2 version of Library. (You might think you could list these specific versions in MyApp’s setup.py – but if you do that you’ll have to edit MyApp if you want to try a new version of Framework, or release a new version of MyApp if you determine that Library 0.3 doesn’t work with your application.) You can also add optional libraries and support tools that MyApp doesn’t strictly require, giving people a set of recommended libraries.

相关问题 更多 >