Fix Python binding build for pip/uv install#27
Open
jloganolson wants to merge 1 commit into
Open
Conversation
- Fix CMake syntax: $(PROJECT_SOURCE_DIR) -> ${PROJECT_SOURCE_DIR}
- Link pybind11::headers to target so build env pybind11 is used
instead of falling back to potentially incompatible system headers
- Add pybind11-stubgen to build-system.requires
- Fix stubgen post-build command to use CMAKE_CURRENT_BINARY_DIR
instead of hardcoded source build path (broken for out-of-source builds)
- Enable BUILD_PYTHON_BINDING in scikit-build cmake defines
- Use SKBUILD_PLATLIB_DIR for install destinations
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Author
|
This work was done to enable use with uv in sibling directories |
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.
Summary
$(PROJECT_SOURCE_DIR)→${PROJECT_SOURCE_DIR}(Make syntax vs CMake syntax, breaks Ninja builds)pybind11::headersto the Python binding target so the build environment's pybind11 is used instead of falling back to potentially incompatible system headerspybind11-stubgentobuild-system.requiressopip install .works without manual pre-installationpybind11-stubgenpost-build command to useCMAKE_CURRENT_BINARY_DIRinstead of hardcoded${CMAKE_SOURCE_DIR}/build(broken for out-of-source / isolated builds)BUILD_PYTHON_BINDINGvia scikit-build cmake definesSKBUILD_PLATLIB_DIRfor install destinationsTest plan
pip install ./uv add .from the SDK root now builds and installs the Python bindings successfullyimport booster_robotics_sdk_pythonworks after install🤖 Generated with Claude Code