Skip to content

Fix Python binding build for pip/uv install#27

Open
jloganolson wants to merge 1 commit into
BoosterRobotics:mainfrom
jloganolson:fix/python-binding-build
Open

Fix Python binding build for pip/uv install#27
jloganolson wants to merge 1 commit into
BoosterRobotics:mainfrom
jloganolson:fix/python-binding-build

Conversation

@jloganolson

Copy link
Copy Markdown

Summary

  • Fix CMake syntax bug: $(PROJECT_SOURCE_DIR)${PROJECT_SOURCE_DIR} (Make syntax vs CMake syntax, breaks Ninja builds)
  • Link pybind11::headers to the Python binding target so the build environment's pybind11 is used instead of falling back to potentially incompatible system headers
  • Add pybind11-stubgen to build-system.requires so pip install . works without manual pre-installation
  • Fix pybind11-stubgen post-build command to use CMAKE_CURRENT_BINARY_DIR instead of hardcoded ${CMAKE_SOURCE_DIR}/build (broken for out-of-source / isolated builds)
  • Enable BUILD_PYTHON_BINDING via scikit-build cmake defines
  • Use SKBUILD_PLATLIB_DIR for install destinations

Test plan

  • pip install . / uv add . from the SDK root now builds and installs the Python bindings successfully
  • import booster_robotics_sdk_python works after install
  • Verified with Python 3.13 + pybind11 3.0.2

🤖 Generated with Claude Code

- 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>
@jloganolson

Copy link
Copy Markdown
Author

This work was done to enable use with uv in sibling directories

@jloganolson jloganolson reopened this Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant