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

- **ID:** `python/setuptools-license-field-deprecated`
- **领域:** python
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

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

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.9 | active | — | — |
| 3.10 | active | — | — |
| 3.11 | active | — | — |
| 3.12 | active | — | — |

## 解决方案

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

## 无效尝试

- **** — Silences the warning but future setuptools will reject the old format. (60% 失败率)
- **** — Temporary; other tools will move to PEP 639. (50% 失败率)
