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

Also available as: JSON · Markdown · 中文
80%Fix Rate
84%Confidence
0Evidence
2024-10-20First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
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

  1. 95% success
    extras_require={'dev': ['pytest>=6.0', 'flake8']}
  2. 92% success
    [project.optional-dependencies]\ndev = ['pytest>=6.0', 'flake8']

Dead Ends

Common approaches that don't work:

  1. 80% fail

    Loses optional dependency functionality; not a proper fix if extras are needed.

  2. 90% fail

    setuptools will not proceed with invalid metadata; build fails.