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

其他格式: JSON · Markdown 中文 · English
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.

generic

解决方案

  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"]

无效尝试

常见但无效的做法:

  1. 70% 失败

    The key will be removed, breaking future builds.

  2. 80% 失败

    Blocks security updates and may conflict with other build requirements.