build: add pyproject.toml for PEP 517/518 support#210
build: add pyproject.toml for PEP 517/518 support#210XueSongTap wants to merge 2 commits intoonnx:mainfrom
Conversation
|
selt test: |
|
Please update you commits with |
|
Thank you for supporting the project. |
Signed-off-by: yexiaochuan <tap91624@gmail.com>
latest commit sign off added |
I think deeply migrating to pyproject.toml not hard. I'll have a try |
I took a closer look. Migrating just the metadata and tool configs into pyproject.toml may be easy, but a full migration is tougher than it looks. Our current setup.py has a lot of custom build logic — things like cmake_build, create_version, build_py, build_ext — and those hook into environment variables and CMake flags. To remove setup.py entirely we’d need to rework that logic inside CMake or switch to something like scikit-build-core, which means touching both the build system and the packaging. It will definitely more effort than a simple config move. |
|
I think there is no need to remove setup.py completely at the moment.. |
|
That’s right. setup.py should still be supported. It’s only that using setup.py develop etc. directly is deprecated. |
|
|
|
|
I've tried full migration of setup.cfg to pyproject.toml based on this PR: #217 |
|
#217 is merged so feel free to have additional contributions |



fix #209
This PR introduces a minimal
pyproject.tomlso that the package can be built through the PEP 517 interface.Currently it still delegates to
setup.py(setuptools.build_metabackend), so all custom CMake build logic remains unchanged.Version constraints
cmake>=3.22– aligned withcmake_minimum_required(VERSION 3.22)in the project’sCMakeLists.txt.protobuf>=4.25.1– consistent with [onnx/onnx requirements](https://github.com/onnx/onnx/blob/main/requirements.txt).setuptools>=68,wheel– ensure stable PEP 517/518/660 support and wheel building.Next steps
This is only the first step: future work can gradually migrate static metadata (name, license, classifiers, URLs, entry points, etc.) from
setup.pyinto the[project]section ofpyproject.toml.