如何在setup.cfg中设置Entry_Points
问题描述
我将配置从setup.py移动到setup.cfg,但设置entry_points
参数时出现问题。不过,目前我使用的是一种有效的混合方法,我想将entry_points
移到setup.cfg。
发件人
def setup_package():
setup(version=get_version(),
entry_points={'console_scripts':['app=my_package.app.run:cli'],})
至
[metadata]
name = my-package
description = my-package
license = unlicensed
long-description = README.md
platforms = any
classifiers =
Programming Language :: Python
[options]
zip_safe = False
packages = my_package, my_package.app
include_package_data = True
package_dir =
= .
tests_require = pytest; pytest-cov
[entry_points]
console_scripts =
my-package = my_package.app.run:cli
解决方案
节必须是[options.entry_points]
。请参阅https://github.com/github/octodns/blob/4b44ab14b1f0a52f1051c67656d6e3dd6f0ba903/setup.cfg#L34
[options.entry_points]
console_scripts =
octodns-compare = octodns.cmds.compare:main
octodns-dump = octodns.cmds.dump:main
octodns-report = octodns.cmds.report:main
octodns-sync = octodns.cmds.sync:main
octodns-validate = octodns.cmds.validate:main
相关文章