Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 15, 2025

Conversation

henryiii
Copy link
Collaborator

@henryiii henryiii commented Apr 2, 2025

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 henryiii force-pushed the henryiii/feat/skbc branch 6 times, most recently from d8188d9 to 098e77b Compare April 3, 2025 21:42
@jcfr
Copy link

jcfr commented Apr 4, 2025

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
Collaborator Author

henryiii commented Apr 5, 2025

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

@henryiii henryiii force-pushed the henryiii/feat/skbc branch from 4eebc66 to 08a874a Compare April 5, 2025 04:11
@henryiii henryiii force-pushed the henryiii/feat/skbc branch 3 times, most recently from d9d3774 to 9d251d7 Compare April 16, 2025 12:39
@henryiii henryiii force-pushed the henryiii/feat/skbc branch from d2cd617 to ce7aec7 Compare May 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 Copilot May 7, 2025 01:41
Copy link
Contributor

@Copilot Copilot AI left a comment

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
File Description
tools/pyproject.toml Removed legacy build-system configuration for setuptools.
tools/make_global.py New script for generating a global configuration for sdist/wheel.
tests/extra_python_package/test_files.py Updated tests to work with the new build backend and file layout.
setup.py Removed in favor of scikit‐build‐core.
pyproject.toml Rewritten to use scikit‐build‐core with updated project metadata.
pybind11/_version.py Adjusted version extraction using regex from the header file.
noxfile.py Updated nox sessions to support both standard and global builds.
docs/conf.py Updated to use pathlib for loading version information.
.pre-commit-config.yaml and workflows files Minor 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

Copy link
Contributor

@cryos cryos left a comment

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.

henryiii added 7 commits May 15, 2025 13:56
Signed-off-by: Henry Schreiner <[email protected]>
Signed-off-by: Henry Schreiner <[email protected]>
Signed-off-by: Henry Schreiner <[email protected]>
Signed-off-by: Henry Schreiner <[email protected]>
Signed-off-by: Henry Schreiner <[email protected]>
@henryiii henryiii force-pushed the henryiii/feat/skbc branch from 7253136 to 787b0e4 Compare May 15, 2025 17:58
@henryiii henryiii merged commit af231a6 into pybind:master May 15, 2025
65 checks passed
@henryiii henryiii deleted the henryiii/feat/skbc branch May 15, 2025 18:39
@github-actions github-actions bot added the needs changelog Possibly needs a changelog entry label May 15, 2025
@henryiii henryiii removed the needs changelog Possibly needs a changelog entry label May 17, 2025
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.

3 participants