# SetuptoolsDeprecationWarning：'license-file' 已弃用；请改用带 glob 模式的 'license-files'。

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

## 根因

setuptools 77+ 弃用单数形式的 license-file 键，改用 license-files（支持 glob 的列表），以符合 PEP 639。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.x | active | — | — |

## 解决方案

1. **** (95% 成功率)
   ```
   # pyproject.toml
[project]
license = "MIT"
license-files = ["LICENSE*", "COPYING*"]
   ```
2. **** (92% 成功率)
   ```
   [project]
license = "MIT"  # or "Apache-2.0 OR MIT"
license-files = ["LICENSE"]
   ```

## 无效尝试

- **** — The key will be removed, breaking future builds. (70% 失败率)
- **** — Blocks security updates and may conflict with other build requirements. (80% 失败率)
