python
config_error
ai_generated
true
error: 'extras_require' must be a dictionary whose values are strings or lists of strings containing valid project/version requirement specifiers.
ID: python/setuptools-extra-requires-invalid
80%Fix Rate
84%Confidence
0Evidence
2024-10-20First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3.x | active | — | — | — |
Root Cause
The extras_require dictionary in setup.py contains invalid requirement specifiers or non-string values.
generic中文
setup.py 中的 extras_require 字典包含无效的需求说明符或非字符串值。
Workarounds
-
95% success
extras_require={'dev': ['pytest>=6.0', 'flake8']} -
92% success
[project.optional-dependencies]\ndev = ['pytest>=6.0', 'flake8']
Dead Ends
Common approaches that don't work:
-
80% fail
Loses optional dependency functionality; not a proper fix if extras are needed.
-
90% fail
setuptools will not proceed with invalid metadata; build fails.