Skip to content

🔧 Add Stable ABI checks to cibuildwheel config#824

Merged
denialhaag merged 3 commits into
mainfrom
stable-abi-checks
Jan 13, 2026
Merged

🔧 Add Stable ABI checks to cibuildwheel config#824
denialhaag merged 3 commits into
mainfrom
stable-abi-checks

Conversation

@denialhaag
Copy link
Copy Markdown
Member

@denialhaag denialhaag commented Jan 13, 2026

Description

This PR adds Stable ABI checks to the cibuildwheel config, after I forgot to do that in #817.

Checklist:

  • The pull request only contains commits that are focused and relevant to this change.
  • I have added appropriate tests that cover the new/changed functionality.
  • I have updated the documentation to reflect these changes.
  • I have added entries to the changelog for any noteworthy additions, changes, fixes, or removals.
  • I have added migration instructions to the upgrade guide (if needed).
  • The changes follow the project's style guidelines and introduce no new warnings.
  • The changes are fully tested and pass the CI checks.
  • I have reviewed my own code changes.

@denialhaag denialhaag requested a review from burgholzer January 13, 2026 11:40
@denialhaag denialhaag self-assigned this Jan 13, 2026
@denialhaag denialhaag added the packaging Anything related to Python packaging label Jan 13, 2026
@github-project-automation github-project-automation Bot moved this to In Progress in MQT Verification Jan 13, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 13, 2026

📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Strengthened validation for Python 3.12 wheel builds with additional compatibility auditing to ensure greater stability and reliability.

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

The change adds a cibuildwheel configuration override for Python 3.12 wheels that appends an abi3audit validation command to the repair-wheel-command, enabling strict ABI compatibility checks during the wheel build process.

Changes

Cohort / File(s) Summary
Build Configuration
pyproject.toml
Added cibuildwheel override for cp312-* targets with inherited repair-wheel-command that appends uvx abi3audit --strict --report {wheel} for ABI validation

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A wheel must be sound, its ABI so tight,
For Python 3.12, we audit with might!
With abi3audit standing guard, strict and proud,
Our binaries dance through compatibility's cloud. 🎡

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Add Stable ABI checks to cibuildwheel config' clearly and specifically describes the main change, which is adding ABI audit functionality to the cibuildwheel configuration.
Description check ✅ Passed The description provides context about what the PR does and references a related issue (#817), though some template checklist items are marked as not applicable.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


📜 Recent review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7df841c and a7f13fd.

📒 Files selected for processing (1)
  • pyproject.toml
🧰 Additional context used
🧠 Learnings (6)
📓 Common learnings
Learnt from: burgholzer
Repo: munich-quantum-toolkit/qcec PR: 817
File: pyproject.toml:81-82
Timestamp: 2026-01-09T17:58:10.350Z
Learning: In the Munich Quantum Toolkit projects using nanobind, setting `wheel.py-api = "cp312"` in `[tool.scikit-build]` enables Stable ABI wheels only for Python 3.12+ (where nanobind supports it), while automatically building regular non-ABI3 wheels for earlier Python versions (3.10, 3.11) and free-threading builds (3.14t). This allows a single configuration to appropriately handle both old and new Python versions without forcing incompatible ABI requirements.
Learnt from: denialhaag
Repo: munich-quantum-toolkit/core PR: 1246
File: pyproject.toml:340-341
Timestamp: 2025-10-09T22:15:59.924Z
Learning: Qiskit publishes ABI3 wheels (e.g., cp39-abi3) that are forward-compatible with newer Python versions including Python 3.14, so no explicit Python 3.14 wheels are required for qiskit to work on Python 3.14.
Learnt from: denialhaag
Repo: munich-quantum-toolkit/debugger PR: 160
File: pyproject.toml:54-54
Timestamp: 2025-10-11T19:39:32.050Z
Learning: Qiskit packages use cp39-abi3 wheels (stable ABI) which are forward-compatible with Python 3.9+ including Python 3.14, even if the package classifiers don't explicitly list Python 3.14 support.
📚 Learning: 2026-01-09T17:58:05.212Z
Learnt from: burgholzer
Repo: munich-quantum-toolkit/qcec PR: 817
File: pyproject.toml:81-82
Timestamp: 2026-01-09T17:58:05.212Z
Learning: For munich-quantum-toolkit/qcec projects using nanobind, configure wheel.py-api = "cp312" under [tool.scikit-build] in pyproject.toml. This enables Stable ABI wheels only for Python 3.12+ (where nanobind supports it) while building regular non-ABI3 wheels for earlier Python versions (e.g., 3.10, 3.11) and free-threading builds (3.14t). This single configuration should correctly handle both old and new Python versions without enforcing incompatible ABI requirements, and applies specifically to the pyproject.toml file in this repository.

Applied to files:

  • pyproject.toml
📚 Learning: 2025-10-10T08:10:16.394Z
Learnt from: burgholzer
Repo: munich-quantum-toolkit/core PR: 1246
File: test/python/na/test_na_fomac.py:35-0
Timestamp: 2025-10-10T08:10:16.394Z
Learning: In the munich-quantum-toolkit/core repository, scikit-build-core is configured with `wheel.install-dir = "mqt/core"` in pyproject.toml, which means CMake `install()` commands with `DESTINATION <path>` install files relative to `mqt/core/` in the wheel, making them accessible via `files("mqt.core").joinpath("<path>")`.

Applied to files:

  • pyproject.toml
📚 Learning: 2025-10-10T08:09:54.528Z
Learnt from: burgholzer
Repo: munich-quantum-toolkit/core PR: 1246
File: bindings/CMakeLists.txt:0-0
Timestamp: 2025-10-10T08:09:54.528Z
Learning: In the Munich Quantum Toolkit (MQT) Core project, scikit-build-core is configured with `wheel.install-dir = "mqt/core"` in pyproject.toml, which automatically prefixes all CMake `DESTINATION` paths with `mqt/core/` during wheel installation. Therefore, CMake install destinations are relative to the `mqt/core` package namespace, not `site-packages`.

Applied to files:

  • pyproject.toml
📚 Learning: 2025-12-14T16:51:52.504Z
Learnt from: burgholzer
Repo: munich-quantum-toolkit/core-plugins-catalyst PR: 23
File: .readthedocs.yaml:13-18
Timestamp: 2025-12-14T16:51:52.504Z
Learning: In the munich-quantum-toolkit/core-plugins-catalyst repository, LLVM and MLIR toolchains are required for the documentation build because `uv run` includes a full build of the package, which compiles C++/MLIR extensions using scikit-build-core.

Applied to files:

  • pyproject.toml
📚 Learning: 2025-12-28T17:13:36.900Z
Learnt from: burgholzer
Repo: munich-quantum-toolkit/core PR: 1403
File: pyproject.toml:98-102
Timestamp: 2025-12-28T17:13:36.900Z
Learning: In the munich-quantum-toolkit/core project, scikit-build-core is intelligent enough to skip build targets listed in pyproject.toml that don't exist for a given platform, so platform-specific targets (like `-dyn` targets conditioned on `NOT WIN32`) can be unconditionally listed in `build.targets` without causing Windows build failures.

Applied to files:

  • pyproject.toml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: 🐍 Test (macos-15-intel) / 🐍 macos-15-intel
  • GitHub Check: 🐍 Test (macos-14) / 🐍 macos-14
  • GitHub Check: 🐍 Test (ubuntu-24.04) / 🐍 ubuntu-24.04
  • GitHub Check: 🐍 Test (windows-2022) / 🐍 windows-2022
  • GitHub Check: 🐍 Test (ubuntu-24.04-arm) / 🐍 ubuntu-24.04-arm
🔇 Additional comments (1)
pyproject.toml (1)

357-361: LGTM! The abi3audit integration correctly validates ABI3 compliance.

The configuration properly appends the audit step to the existing platform-specific repair commands. Using --strict ensures any ABI violations fail the build, and --report provides detailed diagnostics.

Since wheel.py-api = "cp312" produces ABI3 wheels with cp312 as the ABI floor for all Python 3.12+ versions, wheels built with Python 3.13 and 3.14 are also tagged as cp312-abi3-*. The select = "cp312-*" pattern therefore audits all ABI3 wheels across all build versions, making the coverage correct and sufficient.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@burgholzer
Copy link
Copy Markdown
Member

Can we trigger the CD workflow on this PR?
Just to be sure that this also really works and we are not hitting any kind of problems later on? (Might be good to change to draft in the meantime so that CodeRabbit does not critique the changes that are just for testing)

@denialhaag denialhaag marked this pull request as draft January 13, 2026 13:13
@denialhaag
Copy link
Copy Markdown
Member Author

denialhaag commented Jan 13, 2026

Can we trigger the CD workflow on this PR? Just to be sure that this also really works and we are not hitting any kind of problems later on? (Might be good to change to draft in the meantime so that CodeRabbit does not critique the changes that are just for testing)

Done! Judging by the logs of the CD, it also seems to work perfectly. 🤔

Copy link
Copy Markdown
Member

@burgholzer burgholzer left a comment

Choose a reason for hiding this comment

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

Done! Judging by the logs of the CD, it also seems to work perfectly. 🤔

Yeah. This one seems safe to go!
Simply adding the suggestion for the revert of the CD change.

Comment thread .github/workflows/cd.yml Outdated
Co-authored-by: Lukas Burgholzer <burgholzer@me.com>
Signed-off-by: Daniel Haag <121057143+denialhaag@users.noreply.github.com>
@denialhaag denialhaag marked this pull request as ready for review January 13, 2026 13:57
@denialhaag denialhaag enabled auto-merge (squash) January 13, 2026 13:57
@denialhaag denialhaag merged commit 9bc2018 into main Jan 13, 2026
26 checks passed
@denialhaag denialhaag deleted the stable-abi-checks branch January 13, 2026 14:11
@github-project-automation github-project-automation Bot moved this from In Progress to Done in MQT Verification Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

packaging Anything related to Python packaging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants