Skip to main content
Back

SHAP 0.52.0 Rebuilds Its C++ Core and Drops Python 3.11 Support

SHAP v0.52.0 ships a full build system overhaul with nanobind and scikit-build-core, plus GPU TreeExplainer parity fixes and a Python 3.12+ minimum

Repo, Full Access
  • SHAP v0.52.0 released: The ML explainability library ships its biggest infrastructure overhaul in years on PyPI.
  • Build system rewritten: Native C++ bindings migrated from Cython/setup.py to nanobind + scikit-build-core + CMake.
  • Python 3.12+ required: The minimum supported Python version is now 3.12; Python 3.11 and below are dropped.
  • GPU TreeExplainer correctness: NaN routing, multiclass base_score, and categorical handling bugs fixed for XGBoost GPU models.
  • 30+ first-time contributors: Broad community cleanup including pandas nullable dtype crashes, LinearExplainer singular matrix warnings, and PermutationExplainer max_evals fixes.
  • Free, MIT-licensed: Install via pip install --upgrade shap or conda install -c conda-forge shap; full release notes here.

SHAP (SHapley Additive exPlanations) has shipped version 0.52.0, its biggest infrastructure release in years. The headline change is a complete rewrite of the native C++ bindings layer, swapping out the old Cython-based build for nanobind and migrating the entire build system from setup.py to scikit-build-core + CMake. For most users this is invisible at install time, but it matters for long-term maintainability, compile times, and Python version support.

The build system surgery

The native bindings have been rewritten with nanobind, and the build system has been migrated from setup.py to scikit-build-core + CMake. Concretely, this means:

  • The Cython file _kernel_lib.pyx and the old _cext / _cext_gpu modules are now built as nanobind extensions
  • MANIFEST.in and setup.py are gone, replaced by a pyproject.toml-driven build
  • Minimum dependency versions have been raised to follow SPEC 0 , the scientific Python community's standard for dropping old dependency support in a predictable, time-based way

Nanobind is a successor to pybind11 designed for smaller binary sizes, faster compile times, and tighter Python/C++ interop. Moving to it positions SHAP's C++ core for easier future contributions and faster CI builds.