-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate python buildsystem from setuptools to scikit-build-core (#160)
Summary: This PR updates our build system from setuptools to [scikit-build-core](https://scikit-build-core.readthedocs.io/en/latest/), a more modern tool for building CMake-based Python packages. Using scikit-build-core offers several benefits: - Simplified Configuration: Easier build configuration with declarative syntax in pyproject.toml. - Improved Error Handling: Better error reporting and handling reduce debugging time. - Modern Build Tools: Supports Meson and CMake for faster and more efficient builds. - Better Extension Support: Designed specifically for building Python packages with C/C++ extensions. ## Checklist: - [x] Adheres to the [style guidelines](https://facebookincubator.github.io/momentum/docs/developer_guide/style_guide) - [x] Codebase formatted by running `pixi run lint` Test Plan: ``` pixi run test_py ``` Reviewed By: nickyhe-gemini Differential Revision: D66891907 Pulled By: jeongseok-meta
- Loading branch information
1 parent
960a183
commit b017ea6
Showing
7 changed files
with
80 additions
and
171 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
[build-system] | ||
requires = ["scikit-build-core", "pybind11"] | ||
build-backend = "scikit_build_core.build" | ||
|
||
[project] | ||
name = "pymomentum" | ||
version = "0.1.0" | ||
description = "A library providing foundational algorithms for human kinematic motion and numerical optimization solvers to apply human motion in various applications" | ||
readme = "README.md" | ||
requires-python = ">=3.10" | ||
authors = [ | ||
{ name = "Meta Reality Labs Research", email = "[email protected]" }, | ||
] | ||
classifiers = ["License :: OSI Approved :: MIT License"] | ||
dependencies = [] | ||
|
||
[project.urls] | ||
Homepage = "https://github.com/facebookincubator/momentum" | ||
|
||
[tool.scikit-build] | ||
build-dir = "build/{wheel_tag}" | ||
cmake.args = [ | ||
"-DBUILD_SHARED_LIBS=OFF", | ||
"-DMOMENTUM_BUILD_PYMOMENTUM=ON", | ||
"-DMOMENTUM_BUILD_EXAMPLES=OFF", | ||
"-DMOMENTUM_BUILD_TESTING=ON", | ||
"-DMOMENTUM_USE_SYSTEM_GOOGLETEST=ON", | ||
"-DMOMENTUM_USE_SYSTEM_PYBIND11=OFF", | ||
"-DMOMENTUM_USE_SYSTEM_RERUN_CPP_SDK=ON", | ||
] | ||
minimum-version = "0.10" | ||
sdist.exclude = [ | ||
"cmake/", | ||
"test/", | ||
"*.h", | ||
"*.cpp", | ||
"*.cmake", | ||
".clang-format", | ||
"CMakeLists.txt", | ||
] | ||
wheel.exclude = ["geometry_test_helper.*"] | ||
wheel.py-api = "cp310" | ||
|
||
[[tool.scikit-build.overrides]] | ||
if.platform-system = "^win32" | ||
cmake.args = [ | ||
"-DBUILD_SHARED_LIBS=OFF", | ||
"-G Visual Studio 17 2022", | ||
"-DMOMENTUM_BUILD_PYMOMENTUM=ON", | ||
"-DMOMENTUM_BUILD_EXAMPLES=OFF", | ||
"-DMOMENTUM_BUILD_TESTING=ON", | ||
"-DMOMENTUM_USE_SYSTEM_GOOGLETEST=ON", | ||
"-DMOMENTUM_USE_SYSTEM_PYBIND11=ON", | ||
"-DMOMENTUM_USE_SYSTEM_RERUN_CPP_SDK=ON", | ||
] |