Skip to content

[Feature]distinguish whl version#7204

Merged
Jiang-Jia-Jun merged 3 commits intoPaddlePaddle:developfrom
ChowMingSing:feature-whl-version
Apr 7, 2026
Merged

[Feature]distinguish whl version#7204
Jiang-Jia-Jun merged 3 commits intoPaddlePaddle:developfrom
ChowMingSing:feature-whl-version

Conversation

@ChowMingSing
Copy link
Copy Markdown
Contributor

@ChowMingSing ChowMingSing commented Apr 7, 2026

Motivation

rename whl

Modifications

Usage or Command

Accuracy Tests

Checklist

  • Add at least a tag in the PR title.
    • Tag list: [[FDConfig],[APIServer],[Engine], [Scheduler], [PD Disaggregation], [Executor], [Graph Optimization], [Speculative Decoding], [RL], [Models], [Quantization], [Loader], [OP], [KVCache], [DataProcessor], [BugFix], [Docs], [CI], [Optimization], [Feature], [Benchmark], [Others], [XPU], [HPU], [GCU], [DCU], [Iluvatar], [Metax]]
    • You can add new tags based on the PR content, but the semantics must be clear.
  • Format your code, run pre-commit before commit.
  • Add unit tests. Please write the reason in this PR if no unit tests.
  • Provide accuracy results.
  • If the current PR is submitting to the release branch, make sure the PR has been submitted to the develop branch, then cherry-pick it to the release branch with the [Cherry-Pick] PR tag.

@paddle-bot
Copy link
Copy Markdown

paddle-bot bot commented Apr 7, 2026

Thanks for your contribution!

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (develop@f142b48). Learn more about missing BASE report.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #7204   +/-   ##
==========================================
  Coverage           ?   73.26%           
==========================================
  Files              ?      376           
  Lines              ?    52949           
  Branches           ?     8264           
==========================================
  Hits               ?    38791           
  Misses             ?    11445           
  Partials           ?     2713           
Flag Coverage Δ
GPU 73.26% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

@fastdeploy-bot fastdeploy-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Code Review | 2026-04-07 14:15 CST

📋 Review 摘要

PR 概述:将 wheel 包的 Python/ABI/Platform 标签从硬编码值改为使用 packaging.tags 动态获取,使生成的 wheel 文件名能准确反映当前构建环境。

变更范围setup.py (构建配置)

影响面 TagOthers

📝 PR 规范检查

PR 描述中 MotivationModifications 部分未填写具体内容,建议补充说明变更目的和具体修改。

描述模板(可直接复制):

## Motivation

将 wheel 包标签从硬编码的 `py3-none-any` 改为动态获取的系统标签,使生成的 wheel 文件名能准确反映 Python 版本、ABI 和目标平台。

## Modifications

1. 新增 `from packaging import tags` 导入
2.`CustomBdistWheel.finalize_options()` 中使用 `tags.sys_tags()` 获取当前系统的首选标签
3.`python_tag``abi_tag``plat_name` 设置为动态获取的值

问题

级别 文件 概述
🟡 建议 setup.py:30 packaging 包未在 requirements.txt 中显式声明为依赖

总体评价

变更逻辑清晰,能有效区分不同环境构建的 wheel 包。建议补充 packaging 的显式依赖声明以提高可靠性。

setup.py Outdated
from setuptools.command.install import install
from wheel.bdist_wheel import bdist_wheel

from packaging import tags
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 建议 packaging 包未在 requirements.txt 中声明为显式依赖。

虽然 packaging 通常作为 setuptoolswheel 的传递依赖被安装,但直接导入它而不显式声明依赖可能会导致以下风险:

  1. 在某些最小化安装环境中可能找不到 packaging
  2. 无法控制 packaging 的版本,tags API 在不同版本中可能有变化

建议:在 requirements.txt 中添加显式依赖:

packaging>=20.0

@Jiang-Jia-Jun Jiang-Jia-Jun merged commit d693d4b into PaddlePaddle:develop Apr 7, 2026
35 of 38 checks passed
EmmonsCurse pushed a commit to EmmonsCurse/FastDeploy that referenced this pull request Apr 7, 2026
* [Feature]whl version

* [Feature]whl version,set root_is_pure = false

* [Feature]code style
@EmmonsCurse
Copy link
Copy Markdown
Collaborator

✅ Cherry-pick successful! Created PR: #7223

EmmonsCurse pushed a commit to EmmonsCurse/FastDeploy that referenced this pull request Apr 7, 2026
* [Feature]whl version

* [Feature]whl version,set root_is_pure = false

* [Feature]code style
@EmmonsCurse
Copy link
Copy Markdown
Collaborator

✅ Cherry-pick successful! Created PR: #7224

@EmmonsCurse
Copy link
Copy Markdown
Collaborator

ℹ️ Cherry-pick PR already exists: #7223

EmmonsCurse pushed a commit to EmmonsCurse/FastDeploy that referenced this pull request Apr 7, 2026
* [Feature]whl version

* [Feature]whl version,set root_is_pure = false

* [Feature]code style
EmmonsCurse pushed a commit to EmmonsCurse/FastDeploy that referenced this pull request Apr 7, 2026
* [Feature]whl version

* [Feature]whl version,set root_is_pure = false

* [Feature]code style
@EmmonsCurse
Copy link
Copy Markdown
Collaborator

ℹ️ Cherry-pick PR already exists: #7224

Jiang-Jia-Jun pushed a commit that referenced this pull request Apr 7, 2026
* [Feature]whl version

* [Feature]whl version,set root_is_pure = false

* [Feature]code style

Co-authored-by: ChowMingSing <610208940@qq.com>
Copy link
Copy Markdown

@fastdeploy-bot fastdeploy-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Code Review | 2026-04-08

📋 Review 摘要

PR 概述:将 FastDeploy wheel 包从纯 Python 包(py3-none-any)改为平台相关包,使用 packaging.tags 动态获取 Python/ABI/平台标签

变更范围:setup.py

影响面 Tag[CI] [Feature]

📝 PR 规范检查

✅ 标题格式正确,包含 [Feature] 标签
❌ PR 描述不够完整,建议在 Modifications 部分补充说明具体改动内容

描述建议(可直接复制):

## Modifications

-`CustomBdistWheel` 从纯 Python 包(`py3-none-any`)改为平台相关包
- 使用 `packaging.tags.sys_tags()` 动态获取 `{python tag}-{abi tag}-{platform tag}`
- 新增 `packaging` 依赖导入

发现的问题

级别 文件 概述
🟡 建议 setup.py:26 新增 packaging 导入但未在 requirements.txt 中显式声明依赖
🟡 建议 setup.py:51 next(tags.sys_tags()) 缺少异常处理

总体评价

改动的动机是合理的(FastDeploy 包含 C++ 扩展,应标记为平台相关),但建议显式声明 packaging 依赖并添加异常处理以确保健壮性。

from pathlib import Path

import paddle
from packaging import tags
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 建议 新增了 from packaging import tags,但在 requirements.txt 等依赖文件中未显式声明 packaging 依赖。

虽然 packaging 可能被其他依赖(如 setuptools-scm)间接引入,但为了确保环境一致性,建议显式声明:

# 在 requirements.txt 等文件中添加:
+packaging

self.root_is_pure = True
self.python_tag = "py3"
self.abi_tag = "none"
tag = next(tags.sys_tags())
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 建议 next(tags.sys_tags()) 在极端情况下可能抛出 StopIteration 异常(如非常老的 Python 版本或特殊环境)。

建议添加异常处理或默认值:

tag = next(tags.sys_tags(), None)
if tag is None:
    # Fallback to safe defaults
    tag = type('obj', (object,), {
        'interpreter': 'py3',
        'abi': 'none',
        'platform': 'any'
    })()
self.python_tag = tag.interpreter
self.abi_tag = tag.abi
self.plat_name = tag.platform

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants