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
  }, ...
)

参见

那么
进入点有什么用呢?对于项目的用户?除其他外,它允许您安装用户可以使用的脚本。