Repository navigation
fix(deps): 修复 requirements.lock.txt 不可解(numpy / pydantic-core 与 Python 3.11 冲突) - #352
Merged
Merged
Conversation
…n 3.11 冲突) #351 合并后 lock 装不上,`uv pip install -r requirements.lock.txt` 直接解不出解: 1. numpy==2.5.4 要求 Python>=3.12,而项目 .venv 固定 3.11(README: `uv venv --python 3.11`;Android Chaquopy 更老)⇒ 回退 2.4.6。 根因是 dependabot 早先的 numpy minor bump(a8ab228)只改 lock 里一行、 未做版本约束求解;已在 .github/dependabot.yml 对 numpy 暂缓 minor/major, 并写明解除条件(项目最低 Python 升到 3.12)。 2. pydantic-core==2.50.4 与 pydantic==2.14.2 冲突:pydantic 2.14.2 精确要求 pydantic-core==2.50.2 ⇒ 回退 2.50.2。 教训:dependabot 对 requirements*.txt 的单包升级**不做整体一致性求解**, 合并此类 PR 前必须真跑一次 `uv pip install --dry-run -r requirements.lock.txt` (等价于「锁文件可解」探针),不能只看 CI——CI 装的是 requirements.txt。 验证:本地项目级 .venv 用 `uv pip install --python ./.venv/Scripts/python.exe -r requirements.lock.txt` 安装成功(click 8.5.1 / fastapi 0.162.2 / typer 0.28.0 / typing-inspection 0.4.5); 升级后的 .venv 跑全量 pytest:3040 passed,2 failed + 3 errors 均为本地环境既有 问题(GBK 控制台解码、player_tray_probe/probe_json_contract 在纯 master 上同样红)。
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.
问题
合并 #351 后,
uv pip install -r requirements.lock.txt装不上,直接解不出解。两个硬冲突:numpy==2.5.4要求Python>=3.12,项目.venv固定 3.11(READMEuv venv --python 3.11,Android Chaquopy 更老)。pydantic-core==2.50.4与pydantic==2.14.2冲突:pydantic 2.14.2 精确要求pydantic-core==2.50.2。改动
numpy 2.5.4 → 2.4.6、pydantic-core 2.50.4 → 2.50.2。.github/dependabot.yml:对 numpy 暂缓 minor/major,写明解除条件(项目最低 Python 升到 3.12 时移除)。教训(已写进提交信息)
dependabot 对
requirements*.txt的单包升级不做整体一致性求解,会把 lock 改成不可解组合。合并此类 PR 前必须真跑一次uv pip install --dry-run -r requirements.lock.txt——CI 救不了这件事,因为 CI 装的是requirements.txt,不读 lock。验证
uv pip install --python ./.venv/Scripts/python.exe -r requirements.lock.txt安装成功(click 8.5.1 / fastapi 0.162.2 / typer 0.28.0 / typing-inspection 0.4.5 已进项目级 .venv)。player_tray_probe/probe_json_contract在纯 master 上同样红,已用 stash 复验)。