gpt4 book ai didi

python - 如何在 setup.cfg 中设置入口点

转载 作者:太空狗 更新时间:2023-10-29 17:18:53 28 4
gpt4 key购买 nike

我正在将我的配置从 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

关于python - 如何在 setup.cfg 中设置入口点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48884796/

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