pip包依赖问题

发布于 2024-11-18 14:10:47 字数 342 浏览 1 评论 0原文

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

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

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

那么他们的约定是,包不能更改 api,或者是否可以将我需要的包包装到我自己的包中?

take this as example: https://github.com/bitprophet/fabric/blob/master/setup.py#L41

so Fabric requires pycrypto >= 1.9 and paramiko >=1.7.6

what if pycrypto update version to 2.1, and change their api, it will affect my package. this is not the result i want.

so is their a convention that, package can't change api, or is it posible to wrap the package i needed into my own package?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

萤火眠眠 2024-11-25 14:10:47

这个怎么样?

摘录

那么什么是需求文件?它们非常简单:要安装的软件包列表。您可以创建一个类似于以下内容的需求文件,而不是运行 pip MyApp 之类的东西并获取随之而来的任何库:

MyApp
Framework==0.9.4
Library>=0.2

然后,无论 MyApp 在 setup.py 中列出什么,您都将获得特定版本的 Framework (0.9.4) 和至少 0.2 版本的 Library。 (您可能认为您可以在 MyApp 的 setup.py 中列出这些特定版本 - 但如果您这样做,您将必须编辑 MyApp(如果您想尝试新版本的 Framework),或者发布新版本的 MyApp(如果您确定) Library 0.3 不适用于您的应用程序。)您还可以添加 MyApp 并不严格要求的可选库和支持工具,为人们提供一组推荐的库。

how about this?

an excerpt

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文