gpt4 book ai didi

python - setuptools 'entry_points' 参数使用

转载 作者:太空宇宙 更新时间:2023-11-04 10:54:11 25 4
gpt4 key购买 nike

查看一些 python 代码,我发现了 setuptools.setup 函数的参数 entry_points。我在 setuptools/distutils 的任何 API 文档中都看不到这个参数。任何人都可以澄清这个参数应该采用什么格式,或者更好的是,它在 API 文档中的定义是什么?

最佳答案

看看 Distribute 的文档,它好多了。您要查看的部分是 Dynamic Discovery of Services and Plugins :

The entry_points argument to setup() accepts either a string with .ini-style sections, or a dictionary mapping entry point group names to either strings or lists of strings containing entry point specifiers. An entry point specifier consists of a name and value, separated by an = sign. The value consists of a dotted module name, optionally followed by a : and a dotted identifier naming an object within the module.

另一个很好的解释可以在 Hitchhiker’s Guide to Packaging 上找到;有一个部分 dedicated to the entry_points feature :

Entry points are a Setuptools/Distribute feature that’s really handy in one specific case: register something under a specific key in package A that package B can query for.

关于python - setuptools 'entry_points' 参数使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11283693/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com