python config_error ai_generated true

错误:'extras_require' 必须是一个字典,其值为字符串或字符串列表,包含有效的项目/版本需求说明符。

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

其他格式: JSON · Markdown 中文 · English
80%修复率
84%置信度
0证据数
2024-10-20首次发现

版本兼容性

版本状态引入弃用备注
3.x active

根因分析

setup.py 中的 extras_require 字典包含无效的需求说明符或非字符串值。

English

The extras_require dictionary in setup.py contains invalid requirement specifiers or non-string values.

generic

解决方案

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

无效尝试

常见但无效的做法:

  1. 80% 失败

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

  2. 90% 失败

    setuptools will not proceed with invalid metadata; build fails.