python
config_error
ai_generated
true
SetuptoolsDeprecationWarning: `license` as a TOML table is deprecated. Use a SPDX expression string instead.
ID: python/setuptools-license-field-deprecated
80%Fix Rate
87%Confidence
0Evidence
2025-01-14First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3.9 | active | — | — | — |
| 3.10 | active | — | — | — |
| 3.11 | active | — | — | — |
| 3.12 | active | — | — | — |
Root Cause
PEP 639 changes license metadata to SPDX expressions. The old `license = {text = "MIT"}` or `{file = "LICENSE"}` table format is deprecated and will be removed.
generic中文
PEP 639 将许可证元数据改为 SPDX 表达式。旧的 `license = {text = "MIT"}` 或 `{file = "LICENSE"}` 表格式已弃用,将被移除。
Workarounds
-
98% success
[project]\nlicense = "MIT"\nlicense-files = ["LICENSE"]
-
95% success
license = "Apache-2.0 OR MIT"
Dead Ends
Common approaches that don't work:
-
60% fail
Silences the warning but future setuptools will reject the old format.
-
50% fail
Temporary; other tools will move to PEP 639.