python config_error ai_generated true

SetuptoolsDeprecationWarning:将 `license` 作为 TOML 表已弃用。请改用 SPDX 表达式字符串。

SetuptoolsDeprecationWarning: `license` as a TOML table is deprecated. Use a SPDX expression string instead.

ID: python/setuptools-license-field-deprecated

其他格式: JSON · Markdown 中文 · English
80%修复率
87%置信度
0证据数
2025-01-14首次发现

版本兼容性

版本状态引入弃用备注
3.9 active — — —
3.10 active — — —
3.11 active — — —
3.12 active — — —

根因分析

PEP 639 将许可证元数据改为 SPDX 表达式。旧的 `license = {text = "MIT"}` 或 `{file = "LICENSE"}` 表格式已弃用,将被移除。

English

PEP 639 changes license metadata to SPDX expressions. The old `license = {text = "MIT"}` or `{file = "LICENSE"}` table format is deprecated and will be removed.

generic

解决方案

  1. 98% 成功率
    [project]\nlicense = "MIT"\nlicense-files = ["LICENSE"]
  2. 95% 成功率
    license = "Apache-2.0 OR MIT"

无效尝试

常见但无效的做法:

  1. 60% 失败

    Silences the warning but future setuptools will reject the old format.

  2. 50% 失败

    Temporary; other tools will move to PEP 639.