Repository navigation
chore: lock development dependencies with uv - #1576
Draft
liuchongming74 wants to merge 1 commit into
Draft
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
Contributor
Author
|
/retest |
|
🔵 The pipeline #1739 is running. Please wait a moment... (Link) |
|
|
liuchongming74
marked this pull request as draft
November 17, 2026 05:19
liuchongming74
force-pushed
the
codex/uv-lock-migration
branch
from
November 17, 2026 05:20
73a72ee to
561e582
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 安装的元数据目录处理。master。无参数的build.sh编译 Indexed Dataset C++ 扩展,再使用同一解释器调用uv build --wheel打包。npuextra 必须安装 HyperMulticore。下载源按 Python 3.10–3.12 的 ABI 和 CPU 架构匹配 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 开发可在新的独立环境中选择--extra gpu。正式制品发布并重新生成锁文件后,Linux Ascend 环境只需选择
npuextra。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 仍带当前解释器的 ABI 和平台标签。
# 只打包 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.):
561e582d,基于拆仓后的master(f908f4d6)。通过git diff --check、仓库目录检查、pylint、lizard 和 Markdown lint。--extra npu同时选择 HyperMulticore 与 TorchNpu,CPU 和 GPU 安装预演均未选择 HyperMulticore。uv lock --check --offline在下载 HyperMulticore 占位 wheel 时按预期失败。正式 wheel 发布后需重新锁定,验证 CPU、GPU、NPU 同步并运行 Jenkins 门禁。Self-checklist: