You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在setuptools的pyproject.toml中定义pytest插件?

等效的pyproject.toml写法

对应你提供的setup.py中的entry_points配置,在pyproject.toml里可以用以下两种写法实现等效效果:

写法一:键值对形式

[project.entry-points."pytest11"]
copie = "pytest_copi.plugin"

写法二:数组形式

[project.entry-points]
pytest11 = [
    "copie = pytest_copi.plugin",
]

两种写法都能将你的pytest插件正确注册到pytest11这个entry points组中,满足pytest官方对插件注册的要求。

内容的提问来源于stack exchange,提问作者Pierrick Rambaud

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.11 11:47:37