feat(build): scikit-build-core from-source install (#735) - #820
feat(build): scikit-build-core from-source install (#735)#820jiwenc-nv wants to merge 2 commits into
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe project adds scikit-build-core PEP 517/660 packaging with project metadata, dependency groups, CMake options, and editable-install settings. CMake now uses the backend-selected Python interpreter and stages the Python package tree for SKBUILD wheels while preserving the legacy path otherwise. Documentation covers pip source installs, editable behavior, and aarch64 extras. Ubuntu CI builds an sdist, performs an editable install, and runs import and package-discovery smoke tests. Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Developer
participant pip
participant scikit_build_core
participant CMake
participant isaacteleop
Developer->>pip: install from source or editable
pip->>scikit_build_core: invoke PEP 517/660 backend
scikit_build_core->>CMake: configure SKBUILD build
CMake->>isaacteleop: stage compiled and pure-Python package
isaacteleop-->>Developer: provide installed package
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
📝 Docs preview is not auto-deployed for fork PRs. A maintainer with write access to |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/build-ubuntu.yml:
- Around line 295-307: Update the pip-editable-install job to set job-level
permissions to contents: read, and configure its actions/checkout@v6 step with
persist-credentials: false while preserving the existing shallow checkout
behavior.
In `@docs/source/references/build.rst`:
- Around line 78-82: Replace the python -m build --sdist command with uv build
--sdist in both docs/source/references/build.rst lines 78-82 and
docs/source/getting_started/build_from_source/index.rst lines 306-310, using the
already required uv frontend and preserving the documented source-distribution
workflow.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 61fa3db5-c8ad-4ad8-ad52-8e8ef321ee5a
📒 Files selected for processing (6)
.github/workflows/build-ubuntu.ymlcmake/SetupPython.cmakedocs/source/getting_started/build_from_source/index.rstdocs/source/references/build.rstpyproject.tomlsrc/core/python/CMakeLists.txt
27d63ed to
5de3626
Compare
|
/preview-docs |
|
✅ Preview deployed: https://NVIDIA.github.io/IsaacTeleop/preview/pr-820/ |
405b6f1 to
c6c948a
Compare
|
/preview-docs |
|
✅ Preview deployed: https://NVIDIA.github.io/IsaacTeleop/preview/pr-820/ |
b006dc5 to
d244c7e
Compare
d244c7e to
ecb6a1b
Compare
|
/preview-docs |
|
✅ Preview deployed: https://NVIDIA.github.io/IsaacTeleop/preview/pr-820/ |
019475c to
e2b9590
Compare
|
/preview-docs |
|
✅ Preview deployed: https://NVIDIA.github.io/IsaacTeleop/preview/pr-820/ |
e2b9590 to
e1da93e
Compare
|
/preview-docs |
|
✅ Preview deployed: https://NVIDIA.github.io/IsaacTeleop/preview/pr-820/ |
Add a scikit-build-core (PEP 517/660) backend so isaacteleop builds and installs from source with standard tooling (pip install . / -e . / sdist), driving the same top-level CMakeLists.txt as the classic cmake flow. - Version derived from VERSION as MAJOR.MINOR+local; per-Python build dir build/wheel-<cache_tag>; CMake capped to a 3.x line (>=3.20,<4) to match the Ubuntu 22.04/24.04 line. - Full build: a pip install builds the default target -- extensions, examples, C++ tests and plugins (a plugin without its SDK skips) -- and installs every built executable onto the venv PATH (SKBUILD_SCRIPTS_DIR); clang-format is enforced. - CMakePresets.json: py3.10-3.13 presets (build/cmake-<cache_tag>) matching the wheel build-dir tag. - SetupPython.cmake: under SKBUILD, build against the invoking interpreter so the wheel ABI tag matches; python_wheel gated to non-SKBUILD. - tool.uv.package = false so `uv run` / `uv sync` don't implicitly build the project into their env (which turned every `uv run` from the repo into a source build); explicit pip install / uv build still compile. - CI pip-editable-install job (sdist + editable install + import smoke); build-from-source guide and build reference docs. Signed-off-by: Jiwen Cai <jiwenc@nvidia.com>
e1da93e to
087f693
Compare
Switch the Ubuntu and Windows build jobs to the preset-based flow added in NVIDIA#735, so CI configures/builds the same way the build-from-source docs tell users to: cmake --preset py3.12 cmake --build --preset py3.12 --parallel cmake --install build/cmake-cpython-312 - build-ubuntu derives CMAKE_PRESET / BUILD_DIR once from the matrix Python version; the preset supplies ISAAC_TELEOP_PYTHON_VERSION, so the explicit -D is gone. Every path that hardcoded build/ now follows BUILD_DIR: ctest, cmake --install, the gcovr object/exclude dirs (a stale --object-directory silently reports 0% coverage rather than failing) and the viz test-binary packaging step. - build-windows has no Python matrix, so it pins py3.11 -- already the CMakeLists default, so behaviour is unchanged -- via job-level env. - vcpkg caches follow the build directory, since manifest ports install into ${CMAKE_BINARY_DIR}/vcpkg_installed. The preset is part of the cache key: without it, entries saved from the old build/ path would still hit exactly, restore to a path the job never reads, and block the re-save. On Ubuntu this makes the cache per-Python (8 entries instead of 2); Windows stays at 1. test-viz-sanitizers keeps cmake -B build-san: it has no Python dimension and builds with BUILD_PYTHON_BINDINGS=OFF, so no preset applies. Signed-off-by: Jiwen Cai <jiwenc@nvidia.com>
Summary
Adds a root
pyproject.tomlusing the scikit-build-core (PEP 517/660) backend, soisaacteleopbuilds and installs from source with standard Python tooling — the from-source / developer path requested in #735:It drives the same top-level
CMakeLists.txtas the classiccmake -B buildflow, so the two coexist; the classic flow (which CI uses to produceinstall/wheels/and the released wheels) is unchanged.What's in it
pyproject.toml— scikit-build-core backend; extras mirrored fromsrc/core/python/requirements*.txt. Version is derived fromVERSIONasMAJOR.MINOR+local. The build tree is kept per-Python atbuild/wheel-<cache_tag>/, and CMake is capped to a 3.x line (>=3.20,<4) so pip/isolated builds match the Ubuntu 22.04/24.04 line instead of pulling CMake 4.x.pip installbuilds the default target (extensions, examples, C++ tests, and plugins — a plugin without its SDK skips gracefully) and installs every built executable onto the venvPATHvia aSKBUILD-gated loop in the rootCMakeLists.txt(${SKBUILD_SCRIPTS_DIR}). Shared libraries (Python extension modules, plugin.so) are not executables and stay out ofbin/. clang-format is enforced — the build fails ifclang-format-14is missing or any C++ file is unformatted.CMakePresets.json—py3.10–py3.13presets that setISAAC_TELEOP_PYTHON_VERSIONand build intobuild/cmake-<cache_tag>/, sharing the same per-version tag as the wheel build dir so the two never collide.cmake/SetupPython.cmake— underSKBUILD, compile against the interpreter running the build so the wheel's ABI tag matches; the classic uv-managed path is unchanged, and thepython_wheeltarget is gated to non-SKBUILD.pip-editable-installjob (sdist build +pip install -e .+ import/completeness smoke), withclang-format-14installed.retargeters→retargeters-litenote.Behavior / scope notes
MAJOR.MINOR+local(a from-source/dev build); git-aware release versioning (a1/rc1/.devN, tags) stays with the classic flow.src/retargeters/isn't live without re-staging. Making those edits live (a src-layout relocation) is a follow-up..pyistubs (stub generation shells out touv, not guaranteed in pip build isolation); the classic/released wheel still ships them.Validation
Verified locally:
pip install -e .builds and installs the example + test executables into the venvbin/(they run self-contained), andcmake --preset py3.12configures. Thepip-editable-installCI job is the gate for a clean-environment build.Closes #735.