Skip to content

chore: use scikit-build-core for the build - #5598

Merged
henryiii merged 7 commits into
pybind:masterfrom
henryiii:henryiii/feat/skbc
May 15, 2025
Merged

chore: use scikit-build-core for the build#5598
henryiii merged 7 commits into
pybind:masterfrom
henryiii:henryiii/feat/skbc

Conversation

@henryiii

@henryiiihenryiii commented Apr 2, 2025

Copy link
Copy Markdown
Collaborator

Description

Switches to scikit-build-core from setuptools, similar to nanobind. Using PEP 639 licence. The version is read from the C++ files. The CMake files are generated in the wheel step for now. Setup to make the global SDist is a bit different.

Suggested changelog entry:

* Use scikit-build-core for the build backend. The CMake generation has been moved to the sdist->wheel step. ``PYBIND11_GLOBAL_PREFIX`` has been removed.

@henryiii
henryiiiforce-pushed the henryiii/feat/skbc branch 6 times, most recently from d8188d9 to 098e77bCompareApril 3, 2025 21:42
Comment threadCMakeLists.txt
Comment threadnoxfile.py
@jcfr

jcfr commented Apr 4, 2025

Copy link
Copy Markdown

re: Suggested changelog entry

Explain how results previously obtained by setting PYBIND11_GLOBAL_PREFIX can now be achieved. (e.g by running nox -s build_global or by installing a pybind11-global SDist)

@henryiii

Copy link
Copy Markdown
CollaboratorAuthor

As for the explanation, I think that should go in the upgrade guide.

@henryiii
henryiiiforce-pushed the henryiii/feat/skbc branch from 4eebc66 to 08a874aCompareApril 5, 2025 04:11
@henryiiihenryiii mentioned this pull request Apr 14, 2025
@henryiii
henryiiiforce-pushed the henryiii/feat/skbc branch 3 times, most recently from d9d3774 to 9d251d7CompareApril 16, 2025 12:39
@henryiii
henryiiiforce-pushed the henryiii/feat/skbc branch from d2cd617 to ce7aec7CompareMay 1, 2025 17:08
@henryiii
henryiii marked this pull request as ready for review May 7, 2025 00:58
@henryiii
henryiii requested a review from CopilotMay 7, 2025 01:41

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR transitions the project’s build system from setuptools to scikit‐build‐core, removing deprecated setup scripts and updating tests to accommodate the new backend. Key changes include:

  • Removing the build-system block from tools/pyproject.toml and updating the main pyproject.toml with scikit‐build‐core settings.
  • Removing setup.py and associated legacy build logic.
  • Adding tools/make_global.py and adjusting tests and nox sessions to support the new global build process.

Reviewed Changes

Copilot reviewed 11 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
FileDescription
tools/pyproject.tomlRemoved legacy build-system configuration for setuptools.
tools/make_global.pyNew script for generating a global configuration for sdist/wheel.
tests/extra_python_package/test_files.pyUpdated tests to work with the new build backend and file layout.
setup.pyRemoved in favor of scikit‐build‐core.
pyproject.tomlRewritten to use scikit‐build‐core with updated project metadata.
pybind11/_version.pyAdjusted version extraction using regex from the header file.
noxfile.pyUpdated nox sessions to support both standard and global builds.
docs/conf.pyUpdated to use pathlib for loading version information.
.pre-commit-config.yaml and workflows filesMinor changes to remove outdated hooks and extra args.
Files not reviewed (6)
  • CMakeLists.txt: Language not supported
  • MANIFEST.in: Language not supported
  • setup.cfg: Language not supported
  • tests/requirements.txt: Language not supported
  • tools/setup_global.py.in: Language not supported
  • tools/setup_main.py.in: Language not supported
Comments suppressed due to low confidence (1)

tests/extra_python_package/test_files.py:237

  • [nitpick] Verify that the differences in pkg_info assertions between global and non-global builds are intentional and well-documented, ensuring consistency in the expected package metadata.
assert "Provides-Extra: global" not in pkg_info

Comment threadtools/make_global.py

@cryoscryos left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. Nothing jumping out as an issue, CI looks good.

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
@henryiii
henryiiiforce-pushed the henryiii/feat/skbc branch from 7253136 to 787b0e4CompareMay 15, 2025 17:58
@henryiii
henryiii merged commit af231a6 into pybind:masterMay 15, 2025
@henryiii
henryiii deleted the henryiii/feat/skbc branch May 15, 2025 18:39
@github-actionsgithub-actionsBot added the needs changelog Possibly needs a changelog entry label May 15, 2025
@henryiiihenryiii removed the needs changelog Possibly needs a changelog entry label May 17, 2025
@traversaro

Copy link
Copy Markdown

re: Suggested changelog entry

Explain how results previously obtained by setting PYBIND11_GLOBAL_PREFIX can now be achieved. (e.g by running nox -s build_global or by installing a pybind11-global SDist)

In case someone finds this comment on Google (like I did) from what I understand if before you were passing PYBIND11_GLOBAL_PREFIX=ThisIsThePrefix, now you can pass --config-settings=wheel.install-dir=/data/ThisIsThePrefix to the pip invocation.

Sign up for freeto 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.

5 participants

@henryiii@jcfr@traversaro@cryos