Pull Request has been successfully merged by CANN-robot.
(Thank you for zhaozhihui's contribution.)变更摘要
本 PR 将 hixl Python binding 的交付形态从裸 .so 文件改为标准 wheel 包:新增 hixl/__init__.py、setup.py 与 MANIFEST.in,使 C 扩展以 hixl.cpython-3XX-arch.so 形式打包并安装到 site-packages/hixl/ 子目录,同时保留 import hixl 的向后兼容用法。安装/卸载、软链接与权限相关脚本同步从直接拷贝 hixl.so 切换为通过 pip 管理 hixl wheel 及 dist-info;构建脚本 CMakeLists.txt 也相应调整了 EXT_SUFFIX 命名、wheel target 与安装逻辑。
主要改动
- Python 包结构与导出接口:新增
src/python/hixl_py/hixl/__init__.py,从hixl.hixl显式导入并导出全部 C 扩展符号,通过__all__声明 40+ 个常量、类型与函数,为后续 Python 层扩展提供入口。 - Wheel 打包配置:新增
src/python/hixl_py/setup.py,自定义bdist_wheel设置root_is_pure=False并重写get_tag生成平台与 Python 版本标签,同时用BuildPyCommand清理旧 wheel;新增MANIFEST.in使用recursive-include hixl *.so打包扩展。 - 安装逻辑切换为 pip 安装 wheel:
custom_postinst.sh与hixl_custom_install.sh不再复制hixl.so并创建软链接,改为查找hixl-*.whl后通过run_pip install/hixl_install_package安装到目标目录。 - 卸载与软链接逻辑适配 wheel 结构:
custom_prerm.sh、hixl_custom_uninstall.sh将卸载对象从hixl.so改为hixl包及hixl-*.dist-info,并参数化whl_uninstall_package的包名;创建/移除软链接脚本同步改为处理hixl与hixl-*.dist-info。 - 权限与测试路径调整:
install.sh新增对hixl目录及其dist-info的chmod_recur处理;tests/run_test.sh将测试.so拷贝目标从hixl_py/根目录改为hixl_py/hixl/子目录。


Thanks for your pull-request.
The full list of commands accepted by me can be found at here.
You can get sig-info at here.
For more, you also can visit HICANN.
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| repo-cann/hixl | ✅ zhujingjing, lining23666 (2/2) | ✅ zhujingjing (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
zhaozhihui, thanks for your pull request. All authors of the commits have signed the CLA. 👍


/approve


The MR can not be merged, because of CodeReview discussion not resolved
If you want to solve this problem, you can click here to do it in the FAQs.


提交 PR 前,请先阅读 HIXL贡献指南 ,查看 PR 提交方式并遵守相关提交规范。
类型标签
描述
当前 hixl Python binding 以裸
.so文件形式安装,没有__init__.py,不支持 Python 层扩展,且.so文件名不包含平台和 Python 版本信息。本次改动将 hixl Python binding 打包为标准 wheel 包,安装到
site-packages/hixl/子目录下,包含:hixl/__init__.py:显式导出所有 C 扩展符号(__all__列出 40+ 符号),支持后续添加 Python 层接口setup.py:wheel 打包配置,bdist_wheel设置root_is_pure=False生成平台标签MANIFEST.in:包含.so文件用户
import hixl的使用方式完全不变(向后兼容)。测试项
HixlModuleImportTest、HixlDataClassesTest、HixlCapabilityTest共 15 个用例全部通过import hixl向后兼容验证:hixl.SUCCESS、hixl.Hixl()、hixl.MemType等符号均可正常访问测试结果
Checklist
其它(可选)
改动文件清单
src/python/hixl_py/hixl/__init__.pysrc/python/hixl_py/setup.pysrc/python/hixl_py/MANIFEST.insrc/python/hixl_py/CMakeLists.txttests/depends/python/CMakeLists.txttests/run_test.shscripts/package/hixl/scripts/hixl_custom_install.shscripts/package/hixl/rpm_deb/custom_postinst.shscripts/package/hixl/rpm_deb/custom_prerm.shscripts/package/hixl/scripts/hixl_custom_uninstall.shscripts/package/hixl/scripts/hixl_custom_create_softlink.shscripts/package/hixl/scripts/hixl_custom_remove_softlink.shscripts/package/hixl/scripts/install.sh