# 警告：mypkg 1.0 未提供额外项 'dev'

- **ID:** `python/setuptools-missing-extras-requires`
- **领域:** python
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

包元数据未在 extras_require 或 [project.optional-dependencies] 中声明所请求的额外项，因此 pip 仅安装基础包。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.x | active | — | — |

## 解决方案

1. **** (90% 成功率)
   ```
   pip install mypkg pytest ruff mypy
   ```
2. **** (85% 成功率)
   ```
   # in pyproject.toml
[project.optional-dependencies]
dev = ["pytest", "ruff"]
pip install -e '.[dev]'
   ```

## 无效尝试

- **** — --pre enables pre-releases but does not create extras that are not declared. (90% 失败率)
- **** — Upgrading does not add extras to the metadata; the warning persists. (85% 失败率)
- **** — If 'all' is not declared either, the same warning appears for 'all'. (70% 失败率)
