python
config_error
ai_generated
true
SetuptoolsDeprecationWarning:'license-file' 已弃用;请改用带 glob 模式的 'license-files'。
SetuptoolsDeprecationWarning: 'license-file' is deprecated; use 'license-files' with glob patterns instead.
ID: python/setuptools-license-file-deprecated
80%修复率
84%置信度
0证据数
2025-01-08首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 3.x | active | — | — | — |
根因分析
setuptools 77+ 弃用单数形式的 license-file 键,改用 license-files(支持 glob 的列表),以符合 PEP 639。
English
setuptools 77+ deprecates the singular license-file key in favor of license-files (a list supporting globs) to align with PEP 639.
解决方案
-
95% 成功率
# pyproject.toml [project] license = "MIT" license-files = ["LICENSE*", "COPYING*"]
-
92% 成功率
[project] license = "MIT" # or "Apache-2.0 OR MIT" license-files = ["LICENSE"]
无效尝试
常见但无效的做法:
-
70% 失败
The key will be removed, breaking future builds.
-
80% 失败
Blocks security updates and may conflict with other build requirements.