fix(deps): 锁集三处非法约束改为合法,并把 crossconflict 检查接进 CI - #101
Merged
Merged
Conversation
两件事叠在一起,结果是"按 lock 装环境的人拿到破图,而开发机能跑": 1) 锁集自相矛盾(两份清单各三行):tokenizers==0.23.2 同时违反 transformers 4.52.1 要求的 <0.22 与 indextts 要求的 ==0.21.0;antlr4-python3-runtime==4.13.2 违反 hydra-core/omegaconf 的 ==4.9.*;mpmath==1.4.1 违反 sympy 1.14.0 的 <1.4。 改为 0.21.0 / 4.9.3 / 1.3.0(既是唯一合法解,也正是本机跑通真推理的那组版本)。 scripts/check_pin_crossconflicts.py 由 exit 1 → exit 0(95 包,冲突 0,未核验 0)。 2) 检查器从没接线:它只挂在 .pre-commit 的 files: 条件上(改动 lock 才触发), 所以已经坏在 main 上的锁集它永远看不见,CI 一片绿。现在 ci.yml 的 lint job 每次 PR/push 都跑(新增 "Pin cross-constraint gate" 一步)。 顺带纠正一处会把人带偏的声明:pyproject/requirements 的 transformers>=4.57.0(9-14 搭在一条 gpu-smoke 提交里进来的)实测站不住 —— 4.57.6 下 VoxCPM2 正常(合成 243,164 B、 RMS 5360),但 IndexTTS 2.5/2.0 的 infer_v2_5 / infer_v2 直接导入失败;4.52.1 + tokenizers 0.21.0 下三引擎真推理全通(2.5 出 214,040 B / RMS 6176,2.0 出 205,124 B / RMS 6926, VoxCPM2 出 230,148 B / RMS 4615,每次卸载显存回到 ~3.5 GB)。故下界改回 >=4.52.1,<4.53 并把证据写进注释。引擎导入失败时的文案也不再断言"PyPI 无 indextts 包",改为带上底层 ImportError 与"多半是 transformers 版本不匹配"的提示 —— 就是这句话把我误导了两轮。 20 条 Dependabot 告警的可达性与处置逐条见 docs/SECURITY_DEPENDABOT_TRIAGE.md: 结论是没有一条能靠"现在就升级"消掉(4 条 ReDoS 要 4.53+ 被引擎精确 pin 挡住, 4 条要 transformers 5.x,2 条 protobuf 被 descript-audiotools<3.20 与 modelscope<3.21 挡住)。 门禁(冻结树复跑):2078 passed / 35 skipped / 0 failed,覆盖率 52.11%;mypy 103 = 基线; ruff check 通过、359 文件已格式化;完整性清单 16/16;sync_requirements.py 重跑无差异。 Signed-off-by: ReSerendipity <zengyangc@outlook.com>
实测把下界改回 transformers>=4.52.1,<4.53 会让 CI 的两道安全门禁同时变红: pip-audit 扫到 4.52.4 的"4.53 已修"四组 CVE(PYSEC-2025-216、PYSEC-2026-198/228/229/392), docker-build 的 Trivy 扫描步骤同样 exit 1(镜像本身构建成功)。反过来留着 >=4.57.0 门禁是绿的, 但按这份声明装环境的人 IndexTTS 2.0/2.5 都起不来(4.57.6 实测 infer_v2 / infer_v2_5 ImportError;4.52.1 实测三引擎全部加载并出真音频,数字见 docs/SECURITY_DEPENDABOT_TRIAGE.md §2)。 这个取舍涉及安全门禁的松紧,不该由我在修锁集的 PR 里顺手定,所以: - 声明下界原样保留 >=4.57.0 / tokenizers>=0.19.0,并在 pyproject 里写明互斥关系与两条出路 (要么回退下界 + 给两道门禁加逐条带理由的豁免;要么先让 IndexTTS 适配 >=4.53); - 保留本次真正无争议的部分:两份 lock 的三行非法约束(tokenizers 0.23.2→0.21.0、 antlr4 4.13.2→4.9.3、mpmath 1.4.1→1.3.0)、check_pin_crossconflicts 接进 ci.yml、 引擎导入失败时不再断言"PyPI 无 indextts 包"而是带上底层 ImportError、 以及 20 条告警的逐条分诊文档。 复跑(冻结树):check_pin_crossconflicts exit 0(95 包冲突 0)、ruff 通过、 完整性 16/16、2078 passed / 35 skipped / 0 failed、覆盖率 52.12%。 Signed-off-by: ReSerendipity <zengyangc@outlook.com>
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tokenizers==0.23.2同时违反transformers 4.52.1要的<0.22与indextts要的==0.21.0;antlr4-python3-runtime==4.13.2违反 hydra-core/omegaconf 的==4.9.*;mpmath==1.4.1违反 sympy 的<1.4。改到唯一合法且与本箱已验证环境一致的一组:0.21.0 / 4.9.3 / 1.3.0。scripts/check_pin_crossconflicts.py(PR feat(ci): 锁集交叉约束检查,抓 issue #97 那类上界/通配冲突 #98 引入)只挂在 pre-commit 的files:条件上 —— 只有改动 lock 才触发,已经坏在 main 上的锁集它永远看不见。本 PR 把它加进ci.yml的 lint job(Pin cross-constraint gate),每次 PR/push 都跑。pyproject/requirements.txt里transformers>=4.57.0(2026-09-14 搭在一条只讲 gpu-smoke 的提交里进来的)实测站不住 —— 但把它改回>=4.52.1,<4.53会让 CI 两道安全门禁同时变红:pip-audit扫到 4.52.4 的四组"4.53 已修"CVE(PYSEC-2025-216、PYSEC-2026-198/228/229/392),docker-build.yml的 Trivy 扫描步骤同样 exit 1(镜像构建本身成功)。也就是当前 main 的"安全门禁绿"是踩在引擎跑不起来的版本声明上的。本 PR 只落地无争议部分,下界原样保留并在pyproject.toml写明互斥与两条出路:from e保留底层原因、且直接断言"PyPI 无 indextts 包,请从官方仓库安装",而真实情况是模块装着、深处版本错配 —— 这句话把排查带偏了两轮。现在消息里带{type(e).__name__}: {e}与"多半是 transformers 版本不匹配"。docs/SECURITY_DEPENDABOT_TRIAGE.md:20 条 open 告警(= 10 公告 × 2 清单)逐条给严重度、修复版本、谁挡住它、本仓可达性证据与处置建议;GitHub 侧 dismiss 属共享状态,未代做。实测证据(为什么明知有告警还是不升)
Test plan
python scripts/check_pin_crossconflicts.py→ exit 0(95 包,冲突 0,未核验 0;改前 exit 1、8 条冲突)pytest tests/ --ignore=tests/e2e --cov=app/integrated_app --cov-branch --cov-fail-under=45→ 2078 passed / 35 skipped / 0 failed,覆盖率 52.12%check_mypy_ratchet.py→ 103 = 基线;ruff check通过、ruff format --check359 文件已格式化check_integrity_manifest_sync.py→ 16/16 一致(改动的引擎文件不在 16 个签名模块内)scripts/sync_requirements.py重跑 → requirements.txt 与 pyproject 一致(我手改的两行被生成器原样保留)Pin cross-constraint gate)Notes
scripts/gpu_smoke_minimal.py走 OpenAI 口,只有tts-1/tts-1-hd两个模型名,IndexTTS 2.0 不在其中;2.0 今天人工验过但未进冒烟,要接入需改用/api/generate/indextts2形态并在 GPU runner 复验,另案。docs/agents/GOTCHAS.mdchore(main): release 2.2.6 #137。