{
  "id": "python/setuptools-license-file-deprecation",
  "signature": "SetuptoolsDeprecationWarning: `license` as a TOML table is deprecated. Please use a simple string or a `license` file path instead.",
  "signature_zh": "SetuptoolsDeprecationWarning：将 `license` 作为 TOML 表已弃用。请改用简单字符串或 `license` 文件路径。",
  "regex": "SetuptoolsDeprecationWarning:\\ `license`\\ as\\ a\\ TOML\\ table\\ is\\ deprecated\\.\\ Please\\ use\\ a\\ simple\\ string\\ or\\ a\\ `license`\\ file\\ path\\ instead\\.",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "PEP 639 changed the `license` field in pyproject.toml from a table (with `file`/`text` keys) to a plain SPDX string.",
  "root_cause_type": "generic",
  "root_cause_zh": "PEP 639 将 pyproject.toml 中的 `license` 字段从表（含 `file`/`text` 键）改为纯 SPDX 字符串。",
  "versions": [
    {
      "version": "3.9",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.10",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.11",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.12",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.13",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Temporarily hides the warning but breaks compatibility with other packages that require modern setuptools metadata.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Only mutes the warning; the deprecated table form will stop being parsed in a future release.",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.93,
      "how": "Migrate to PEP 639: replace `license = {file = 'LICENSE'}` with `license = 'MIT'` and add `license-files = ['LICENSE']`.",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.8,
      "how": "If you must keep the old form for a transition, pin `setuptools<77` in build-system.requires and add a TODO to migrate.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.86,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-01-15",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}