Repository navigation
chore: lock development dependencies with uv - #1576
Open
liuchongming74 wants to merge 1 commit into
Open
liuchongming74 wants to merge 1 commit into
liuchongming74 wants to merge 1 commit into
Conversation
liuchongming74
marked this pull request as ready for review
November 14, 2026 18:48
liuchongming74
requested review from
Probiotics5333,
davidhe91,
kisnwangg,
suteng,
yangzhenzhang02 and
yaoyifanx
as code owners
November 14, 2026 18:48
liuchongming74
force-pushed
the
codex/uv-lock-migration
branch
3 times, most recently
from
November 15, 2026 06:35
4094760 to
5b84fae
Compare
liuchongming74
force-pushed
the
codex/uv-lock-migration
branch
from
November 15, 2026 06:47
5b84fae to
f01f668
Compare
3 of 5 tasks
liuchongming74
force-pushed
the
codex/uv-lock-migration
branch
4 times, most recently
from
November 15, 2026 12:50
5ddd94d to
6e5d40f
Compare
Contributor
Author
|
/check-pr |
Contributor
Author
|
/retest |
|
🔵 The pipeline #1702 is running. Please wait a moment... (Link) |
|
|
@liuchongming74, your gate pipeline failed at the code check stage. You can configure some code check tools locally following the (pre-push quick guide), to enable automatic checking when you push your code every time. Tools included are: Check_CMakelint, Check_Codespell, Check_Cpplint, Check_Lizard, Check_Pylint, Check_ClangFormat, Check_ShellCheck. |
liuchongming74
force-pushed
the
codex/uv-lock-migration
branch
from
November 15, 2026 14:40
6e5d40f to
c53765b
Compare
Contributor
Author
|
/check-pr |
Contributor
Author
|
/retest |
|
🔵 The pipeline #1703 is running. Please wait a moment... (Link) |
|
liuchongming74
force-pushed
the
codex/uv-lock-migration
branch
from
November 15, 2026 15:05
c53765b to
73a72ee
Compare
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.
Paired: GitHub #1576 ↔ GitCode !1953
What type of PR is this?
/kind task
What does this PR do / why do we need it:
让 HyperParallel 的多设备 Python 依赖可复现、可审查。 项目同时维护 CPU、NVIDIA GPU 和 Ascend NPU 的 PyTorch 版本组合及 wheel 来源。uv 将这些规则集中到
pyproject.toml,并把解析出的版本和来源记录在uv.lock。开发者检出同一提交后,可用uv sync --locked在相同平台和设备组合下复现依赖。锁文件过期时,同步会报错,依赖升级也能作为 PR 差异审查。Conda 环境仍可通过
--python提供基础解释器,项目依赖同步到独立的 uv 虚拟环境。现有 pip 安装入口、GPU/NPU 训练环境和 Jenkins 门禁继续沿用。pyproject.toml中声明开发和测试依赖组,便于按用途同步。requirements.txt声明运行时依赖。将 8 个 PyTorch extras 统一移到pyproject.toml,保留版本、平台条件和 pip 安装入口。修正 editable 安装的元数据目录处理。build.sh复用当前环境的 Python,通过现有组件脚本编译原生库,再用uv build --wheel打包暂存产物。pyproject.toml、uv.lock和setup.py指定唯一代码所有者@liuchongming74。强制要求代码所有者审批需在master规则集中启用对应选项。uv 使用示例
以下命令从仓库根目录执行。
1. 使用
uv sync初始化开发环境# 若尚未安装 uv,在已激活的 Conda 环境或其他工具环境中安装项目所用版本。 python -m pip install uv==0.11.16A. 同步到独立的 uv 虚拟环境
UV_PROJECT_ENVIRONMENT指定依赖安装的位置。以下示例将项目和依赖安装到仓库内的.venv-uv,系统 Python 和现有训练环境保持原状。Conda 可提供基础解释器,将--python 3.12改为--python "$CONDA_PREFIX/bin/python"即可。GPU 或 NPU 开发可在新的独立环境中选择--extra gpu或--extra npu。B. 同步到系统 Python
适用于专用容器等可写的 Python 安装。
--inexact保留项目未声明的包,但仍可能替换项目依赖的已有版本。操作系统管理的 Python 可能拒绝写入。也可以用 pip 兼容接口按
requirements.txt的版本范围安装运行时依赖。uv 项目环境路径 · uv 系统环境安装
2. 使用 uv 编译和构建 wheel
在 Linux 上,构建含 Indexed Dataset C++ 扩展的 wheel 需要与 Python 版本匹配的开发头文件和 C++17 工具链。
build.sh先编译原生扩展,再让uv build --wheel使用同一个 Python 解释器打包。只需要纯 Python wheel 时,可直接指定开发环境的解释器。
# 只打包 Python 源码,输出到 dist/core-only。 uv build --wheel --python .venv-uv/bin/python --out-dir dist/core-onlyWhich issue(s) this PR fixes:
无关联 Issue。
Test Plan and Test result:What scenarios were tested, and what were the verification results(Function, performance, reliability, etc.):
73a72eef。现有 Jenkins 门禁继续沿用。下述原生编译和 pip 打包验证来自97a93ce7,对应的构建、打包和依赖配置与当前提交一致。CODEOWNERS路径都只匹配@liuchongming74,并通过git diff --check。uv.lock中三个 PyPI 制品记录报出敏感词误报。将这三个制品的完整 SHA-256 校验值加入现有 Jenkins 白名单。本地核对这些条目仅匹配日志报告的三行。uv lock --check,uv.lock逐字节一致。build.sh --multicore off --strict on,实际编译 C++ 索引扩展并用 uv 构建 wheel。迁移前后 8 个 extras、Requires-Dist、Requires-Python和 wheel 标签完全一致,新增 wheel 内的.so与暂存文件逐字节一致。pip check。原源码入口pip install -e '.[cpu]'通过且导入指向该 checkout。97a93ce7在指定 Linux ARM64 机器的隔离环境中通过锁定数据单测(35 项单测、41 项子测试)。当前提交的依赖配置、锁文件和用例与该验证版本一致,可按上面的命令在本地复验。requirements.txt后,uv lock --check正确拒绝旧锁。Self-checklist: