Python 使用“入口点”添加setuptools命令`
是否可以使用Python 使用“入口点”添加setuptools命令`,python,setuptools,Python,Setuptools,是否可以使用setup()调用的entry\u points参数将自定义setuptools命令添加到项目中 例如,我已将其添加到项目的setup()调用中: entry_points = { 'distutils.commands': [ 'abc = sphinx.setup_command:BuildDoc', ], }, 但是当我执行python setup.py--help命令时,仍然没有得到abc命令。有什么想法吗 如果您的目标是添加一个通过$pyt
setup()
调用的entry\u points
参数将自定义setuptools
命令添加到项目中
例如,我已将其添加到项目的setup()
调用中:
entry_points = {
'distutils.commands': [
'abc = sphinx.setup_command:BuildDoc',
],
},
但是当我执行python setup.py--help命令时,仍然没有得到abc
命令。有什么想法吗
如果您的目标是添加一个通过$python./setup.py abc
运行的setuptools
命令,那么我在以下方面取得了成功
import sphinx.setup_command
setup(
...
cmdclass={
'abc': sphinx.setup_command.BuildDoc
}, ...
)
参见那么进入点有什么用呢?对于项目的用户?除其他外,它允许您安装用户可以使用的脚本。