Skip to content

Switch Python packaging to scikit-build-core - #298

Merged
zfergus merged 2 commits into
mainfrom
chore/scikit-build-core
Nov 9, 2026
Merged

zfergus merged 2 commits into
mainfrom
chore/scikit-build-core

Conversation

@zfergus

@zfergus zfergus commented Nov 9, 2026

Copy link
Copy Markdown
Member

Description

Replaces the hand-written setup.py (setuptools plus a custom CMake build_ext) with scikit-build-core, touching only the Python packaging, its docs, and the CI path filters.

  • [tool.scikit-build] in pyproject.toml drives CMake: a Release build of only the ipctk target, in a persistent build/<wheel tag>/ folder.
  • python/CMakeLists.txt installs the module into a python component under if(SKBUILD), and the wheel holds only that component.
  • setup.py and MANIFEST.in are removed. The sdist is the git-tracked files minus .github/, docs/ (except PYPI_README.md), notebooks/, and tests/.

Impacts:

  • Wheels drop from 297 files to 5 (3.2 MB → 2.6 MB on macOS arm64). On main, setuptools' package discovery treats src/ as a src-layout and ships 291 C++ sources as a top-level ipc/ package in site-packages.
  • Third-party install rules (oneTBB's headers and static libraries, ...) stay out of the wheel.
  • Reinstalls are incremental: a repeat in-tree pip install . takes 30 s instead of 111 s.
  • The minimum Python goes from 3.6 to 3.8, the floor of both pybind11 3 and scikit-build-core.

Build options

  • IPCTK_WITH_SIMD and CMAKE_ARGS work as before, so the CI workflows only change their path filters.
  • CMake options can also be passed with pip install . -C cmake.define.<NAME>=<VALUE>.
  • CMake and Ninja are fetched from PyPI only when the system lacks suitable versions.

Breaking changes

  • DEBUG=1 pip install . no longer builds in Debug; use SKBUILD_CMAKE_BUILD_TYPE=Debug (or -C cmake.build-type=Debug).
  • An empty IPCTK_WITH_SIMD= now disables SIMD, since CMake treats an empty value as false. Before, it kept SIMD on.
  • python setup.py ... commands are gone; use pip install . or python -m build.

Type of change

  • Enhancement (non-breaking change which improves existing functionality)
  • This change requires a documentation update

How Has This Been Tested?

  • Built the sdist, then built a wheel from that sdist, which checks the sdist is complete.
  • Installed the wheel in a clean venv and ran nose2 in python/tests: 107 tests pass.
  • Compared its contents against a wheel built from main with setup.py.
  • IPCTK_WITH_SIMD=0 pip install . gives IPC_TOOLKIT_WITH_SIMD:BOOL=0 in the CMake cache.
  • The Linux, Windows, and CUDA wheels are covered by pypi.yml, which runs on this PR.

Test Configuration:

  • OS and Version: macOS 27.2 (arm64)
  • Compiler and Version: AppleClang 21.0, Python 3.13

Checklist

  • I have followed the project style guide
  • My code follows the clang-format style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

zfergus and others added 2 commits November 9, 2026 00:11
- Replace setup.py and MANIFEST.in with [tool.scikit-build] config
- Install only the module, so wheels no longer ship src/ipc sources
- Keep IPCTK_WITH_SIMD and CMAKE_ARGS working

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pybind11 3 and scikit-build-core both require Python 3.8 or newer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zfergus
zfergus merged commit 54d2de2 into main Nov 9, 2026
31 of 46 checks passed
@zfergus
zfergus deleted the chore/scikit-build-core branch November 9, 2026 15:16
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