chore: split runtime and development dependencies (#5985)

This commit is contained in:
InfinityPacer
2026-06-22 17:44:06 +08:00
committed by GitHub
parent 7a7b27858e
commit e44a6f41b5
11 changed files with 68 additions and 96 deletions

View File

@@ -15,7 +15,7 @@ python tests/run.py # 等价于 pytest 全量(参数透
- 不再使用 `python -m unittest discover`:它不导入 `tests` 包、收不到纯函数用例,且绕过 `conftest.py` 的隔离。
- 不再依赖 `python tests/test_xxx.py` 直跑:所有 `if __name__ == "__main__": unittest.main()` 尾巴已移除。
- **复现 CI 用干净环境**:建议用一个仅 `pip install -r requirements.in pytest` 的虚拟环境运行,避免本地额外包或编译产物掩盖问题。
- **复现 CI 用干净环境**:建议用一个仅 `pip install -r requirements-dev.in` 的虚拟环境运行,避免本地额外包或编译产物掩盖问题。
## 隔离模型(`tests/conftest.py`
@@ -133,4 +133,4 @@ def test_recognize_prefers_explicit_id(sample_meta, monkeypatch):
- **门禁**`.github/workflows/test.yml` 在指向 `v2` 的 `pull_request` / `push` 及手动触发时,用 `python tests/run.py` 跑全量单测。
- **PR**`python tests/run.py` 确认全绿、且 socket 探针零真实出站,避免把红的改动推上去空耗门禁。
- 复现 CI 用仅安装 `requirements.in` 的干净环境(含 pytest 与可选扩展),保证可选扩展、动态模块的存在性与 CI 一致
- 复现 CI 用仅安装 `requirements-dev.in` 的干净环境`requirements.in` 只承载运行时依赖pytest 与覆盖率插件由开发依赖入口提供