列出 python 包依赖项而不加载它们?
假设Python包A需要B、C和D; 有没有办法列出 A → BCD 而不加载它们?
元数据 (yolk -M A
) 中的 Requires
通常不完整,grr。
可以下载A.tar / A.egg,然后查看A/setup.py, 但其中一些非常血腥。
(我原以为至少可以机械化获得第一级依赖关系; 即使是 98% 的解决方案也比雪崩般的下载更好。)
Say that python package A requires B, C and D;
is there a way to list A → B C D without loading them ?Requires
in the metadata (yolk -M A
) are often incomplete, grr.
One can download A.tar / A.egg, then look through A/setup.py,
but some of those are pretty gory.
(I'd have thought that getting at least first-level dependencies could be mechanized;
even a 98 % solution would be better than avalanching downloads.)
A related question:
pip-upgrade-package-without-upgrading-dependencies
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Snakefood
将列出依赖项。
要从标准库中过滤掉模块,您可以使用
正如您已经注意到的,如果您想忽略其他目录,您还可以使用 sfood -I 标志。
Snakefood
will list the dependencies.
To filter out modules from the standard library, you could use
As you've already noted, if there are other directories you'd like ignored, you can also use the
sfood -I
flag.标准库中的 modulefinder
我不确定它是否符合您关于不加载模块的要求。 从这里:
有关使用 pylint 或 Gui2exe 的其他提示此处
modulefinder from the standard lib
I am not sure if it complies with your requierement about not loading the modules. From here:
Other hints about the use of pylint or Gui2exe here
如果您所说的包是指 pip 安装的包(而不是带有 __init__.py 的目录),那么您可以使用名为 pip 的 Python 包。例如:
If by package you mean a pip installed package (and not a directory with an __init__.py), then you can use the Python package called pip. For example: