Repository navigation
fix(dev): pin the interpreter for make install - #2594
Conversation
| install: ## Install the virtual environment and install the prek hooks | ||
| @echo "🚀 Creating virtual environment using uv" | ||
| @uv sync | ||
| @uv sync --locked --python 3.13 |
There was a problem hiding this comment.
[P2] 解释器 pin 与 CI 的安装路径不一致
正文称 3.13 "matches what tox.ini, the CI workflows and #2402 already use",在该 head 上不成立:
- 共享安装入口
.github/actions/setup-python-env/action.yml的python-version默认值是3.12,安装步骤为uv sync --frozen;master.yml的 quality 作业显式传3.12。 .github/workflows中所有显式uv sync都 pin3.12:desktop.yml:108/:321/:384、desktop-candidate.yml:39/:92/:183、managed-resource-candidates.yml:61。没有任何 workflow 用 3.13 安装。tox.ini是uv sync --locked --python {envpython}配envlist = py311..py314,3.13 只是四个矩阵项之一,不是"CI 已使用的那个版本"。
影响:make install 建立的 .venv 就是 make check / make unit-test 使用的环境。pin 到 3.13 后,本地解释器与 CI 的安装/质量路径(3.12)以及安装验证矩阵(3.11、3.14)都不相同;只存在于 3.13 的解析差异(例如某个 locked wheel 在 3.12 上缺失)在两侧都看不到。#2593 写的期望正是"resolve the same interpreter and wheels as CI"。
建议改为 uv sync --locked --python 3.12(与 Makefile 其余 uv sync 的 pin 一致),或在正文说明为何选 3.13 而不是 CI 使用的 3.12。
补充:该 head 只有 license/cla commit status、0 个 check run,以上判断为源码级核对(.github/actions/setup-python-env/action.yml、master.yml、各 workflow 的 uv sync 行、tox.ini),没有 CI 佐证。
There was a problem hiding this comment.
Good catch — you're right, and the PR description was wrong.
CI installs with 3.12: .github/actions/setup-python-env/action.yml defaults to
it and every explicit uv sync in .github/workflows passes it. #2402 pins
3.13, but only for the evaluation containers, and I carried that over
incorrectly. tox.ini runs the 3.11–3.14 matrix, so 3.13 is one of four, not
"the version CI uses".
Changed to uv sync --locked --python 3.12 in 6d57055, which matches the
remaining uv sync invocations in the same Makefile and the CI install path.
Re-verified locally: .venv is now CPython 3.12.16 and make check runs its
release / upgrade-policy / workflow-actions / lock-consistency checks and prek
hooks against it.
With 3.12 the expectation in #2593 — "resolve the same interpreter and wheels as
CI" — now holds. I've also updated the PR description to stop claiming 3.13
matches CI. Thanks for the source-level check.
Closes #2593
Rationale for this change
make installis the entry point CONTRIBUTING.md gives contributors, and it wasthe only
uv syncin the Makefile without--lockedor an explicit interpreter.Without a pin, uv resolves CPython 3.15, where
uv.lockhas no wheels for tenpackages and the build fails on machines without a Rust toolchain. Without
--locked, a drifted lock file would be rewritten instead of failing, which isthe drift AGENTS.md asks contributors to catch with
make check.What changes are included in this PR?
Makefile:4now runsuv sync --locked --python 3.12.3.12matches the CI install path:.github/actions/setup-python-env/action.ymldefaults to it, every explicit
uv syncin.github/workflowspasses it, and theremaining
uv syncinvocations in this Makefile pin the same way. No other entrypoint, file or behaviour is touched.
For completeness: the same missing pin also affects
README.md:205,README_CN.md:202andintegrations/cindy/README.md:15/:18. I kept thischange scoped to
make installas reported; happy to extend it in a follow-upif you want those covered.
Are there any user-facing changes?
No. Contributors without Rust now get a working
make install; the pin will needupdating once the locked wheels cover a newer interpreter.
How was this change tested?
the unpinned
uv syncselected CPython 3.15.2 and failed buildingtiktoken==0.13.0(can't find Rust compiler).make checkpasses the release, upgrade-policy, workflow-actions andlock-consistency checks, and the
prekhooks.ty checkreports 102 diagnostics on this machine. They are the Windowsplatform diagnostics
desktop/VALIDATION.mdalready records (for examplesocket.AF_UNIXdoes not exist on Windows, and those UDS tests are skippedthere). Linux-target type checks are the ones CI gates on.
make unit-test: the change only alters the command line of theinstalltarget, with no Python code, tests or configuration affected.AI usage statement
Used an AI assistant for reproduction guidance and wording; every command and
result above was run and verified by me on my own machine.