python config_error ai_generated true

SetuptoolsDeprecationWarning: 'license-file' is deprecated; use 'license-files' with glob patterns instead.

ID: python/setuptools-license-file-deprecated

Also available as: JSON · Markdown · 中文
80%Fix Rate
84%Confidence
0Evidence
2025-01-08First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.x active

Root Cause

setuptools 77+ deprecates the singular license-file key in favor of license-files (a list supporting globs) to align with PEP 639.

generic

中文

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

Workarounds

  1. 95% success
    # pyproject.toml
    [project]
    license = "MIT"
    license-files = ["LICENSE*", "COPYING*"]
  2. 92% success
    [project]
    license = "MIT"  # or "Apache-2.0 OR MIT"
    license-files = ["LICENSE"]

Dead Ends

Common approaches that don't work:

  1. 70% fail

    The key will be removed, breaking future builds.

  2. 80% fail

    Blocks security updates and may conflict with other build requirements.