Skip to content

feat(setup): migrate to Python_FIND_ABI for CMake's FindPython - #292

Merged
XuehaiPan merged 3 commits into
metaopt:mainfrom
XuehaiPan:fix-cmake-findpython
Aug 18, 2026
Merged

feat(setup): migrate to Python_FIND_ABI for CMake's FindPython#292
XuehaiPan merged 3 commits into
metaopt:mainfrom
XuehaiPan:fix-cmake-findpython

Conversation

@XuehaiPan

Copy link
Copy Markdown
Member

Description

Describe your changes in detail.

Motivation and Context

Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
You can use the syntax close #15213 if this solves the issue #15213

  • I have raised an issue to propose this change (required for new features and bug fixes)

Types of changes

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds core functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (update in the documentation)

Checklist

Go over all the following points, and put an x in all the boxes that apply.
If you are unsure about any of these, don't hesitate to ask. We are here to help!

  • I have read the CONTRIBUTION guide. (required)
  • My change requires a change to the documentation.
  • I have updated the tests accordingly. (required for a bug fix or a new feature)
  • I have updated the documentation accordingly.
  • I have reformatted the code using make format. (required)
  • I have checked the code using make lint. (required)
  • I have ensured make test pass. (required)

@XuehaiPan XuehaiPan self-assigned this Aug 16, 2026
@XuehaiPan XuehaiPan added cxx Something related to the CXX source code dependencies Pull requests that update a dependency file upstream Something related to upstream projects labels Aug 16, 2026
@codecov

codecov Bot commented Aug 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (5336257) to head (15c46e0).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #292   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           15        15           
  Lines         1655      1655           
  Branches       225       225           
=========================================
  Hits          1655      1655           
Flag Coverage Δ
unittests 100.00% <ø> (ø)
unittests-cp310-Linux 100.00% <ø> (ø)
unittests-cp310-Windows 100.00% <ø> (ø)
unittests-cp310-macOS 100.00% <ø> (ø)
unittests-cp311-Linux 100.00% <ø> (ø)
unittests-cp311-Windows 100.00% <ø> (ø)
unittests-cp311-macOS 100.00% <ø> (ø)
unittests-cp312-Linux 100.00% <ø> (ø)
unittests-cp312-Windows 100.00% <ø> (ø)
unittests-cp312-macOS 100.00% <ø> (ø)
unittests-cp313-Linux 100.00% <ø> (ø)
unittests-cp313-Windows 100.00% <ø> (ø)
unittests-cp313-macOS 100.00% <ø> (ø)
unittests-cp313t-Linux 100.00% <ø> (ø)
unittests-cp313t-Windows 100.00% <ø> (ø)
unittests-cp313t-macOS 100.00% <ø> (ø)
unittests-cp314-Linux 100.00% <ø> (ø)
unittests-cp314-Windows 100.00% <ø> (ø)
unittests-cp314-macOS 100.00% <ø> (ø)
unittests-cp314t-Linux 100.00% <ø> (ø)
unittests-cp314t-Windows 100.00% <ø> (ø)
unittests-cp314t-macOS 100.00% <ø> (ø)
unittests-cp315-Linux 100.00% <ø> (ø)
unittests-cp315-Windows 100.00% <ø> (ø)
unittests-cp315-macOS 100.00% <ø> (ø)
unittests-cp315t-Linux 100.00% <ø> (ø)
unittests-cp315t-Windows 100.00% <ø> (ø)
unittests-cp315t-macOS 100.00% <ø> (ø)
unittests-cp39-Linux 100.00% <ø> (ø)
unittests-cp39-Windows 100.00% <ø> (ø)
unittests-cp39-macOS 100.00% <ø> (ø)
unittests-pp311-Linux 100.00% <ø> (ø)
unittests-pp311-Windows 100.00% <ø> (ø)
unittests-pp311-macOS 100.00% <ø> (ø)
unittests-pydebug 100.00% <ø> (ø)
unittests-pydebug-cp310d-Linux 100.00% <ø> (ø)
unittests-pydebug-cp310d-Windows 100.00% <ø> (ø)
unittests-pydebug-cp310d-macOS 100.00% <ø> (ø)
unittests-pydebug-cp311d-Linux 100.00% <ø> (ø)
unittests-pydebug-cp311d-Windows 100.00% <ø> (ø)
unittests-pydebug-cp311d-macOS 100.00% <ø> (ø)
unittests-pydebug-cp312d-Linux 100.00% <ø> (ø)
unittests-pydebug-cp312d-Windows 100.00% <ø> (ø)
unittests-pydebug-cp312d-macOS 100.00% <ø> (ø)
unittests-pydebug-cp313d-Linux 100.00% <ø> (ø)
unittests-pydebug-cp313d-Windows 100.00% <ø> (ø)
unittests-pydebug-cp313d-macOS 100.00% <ø> (ø)
unittests-pydebug-cp313td-Linux 100.00% <ø> (ø)
unittests-pydebug-cp313td-Windows 100.00% <ø> (ø)
unittests-pydebug-cp313td-macOS 100.00% <ø> (ø)
unittests-pydebug-cp314d-Linux 100.00% <ø> (ø)
unittests-pydebug-cp314d-Windows 100.00% <ø> (ø)
unittests-pydebug-cp314d-macOS 100.00% <ø> (ø)
unittests-pydebug-cp314td-Linux 100.00% <ø> (ø)
unittests-pydebug-cp314td-Windows 100.00% <ø> (ø)
unittests-pydebug-cp314td-macOS 100.00% <ø> (ø)
unittests-pydebug-cp315d-Linux 100.00% <ø> (ø)
unittests-pydebug-cp315d-Windows 100.00% <ø> (ø)
unittests-pydebug-cp315d-macOS 100.00% <ø> (ø)
unittests-pydebug-cp315td-Linux 100.00% <ø> (ø)
unittests-pydebug-cp315td-Windows 100.00% <ø> (ø)
unittests-pydebug-cp315td-macOS 100.00% <ø> (ø)
unittests-pydebug-cp39d-Linux 100.00% <ø> (ø)
unittests-pydebug-cp39d-Windows 100.00% <ø> (ø)
unittests-pydebug-cp39d-macOS 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

Only set the automatic Python_FIND_ABI hint with CMake 4.1.2 or newer, while preserving explicit overrides from setup.py. Detect the interpreter ABI in CMake where FindPython handles module-only artifacts correctly.
Add Python 3.14 and 3.15 to the Pyodide build matrix so the FindPython compatibility path is covered by CI.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Migrates CMake Python ABI discovery to Python_FIND_ABI, improving debug and free-threaded Python build support.

Changes:

  • Detects and forwards Python debug/free-threaded ABI flags.
  • Expands Pyodide testing and removes the obsolete Windows CMake pin.
  • Updates changelog, spelling dictionary, and pre-commit dependencies.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
CMakeLists.txt Configures Python_FIND_ABI for supported CMake versions.
setup.py Logs ABI variables and forwards ABI overrides.
src/CMakeLists.txt Aligns command formatting.
pyproject.toml Adds Pyodide test configuration.
.github/workflows/build.yml Adds Python 3.14–3.15 Pyodide builds.
.github/workflows/tests-with-pydebug.yml Removes the obsolete CMake version pin.
.pre-commit-config.yaml Updates Ruff and mypy hooks.
docs/source/spelling_wordlist.txt Adds ABI-related terminology.
CHANGELOG.md Records the migration.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@XuehaiPan
XuehaiPan merged commit 2928b52 into metaopt:main Aug 18, 2026
473 of 482 checks passed
@XuehaiPan
XuehaiPan deleted the fix-cmake-findpython branch August 18, 2026 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cxx Something related to the CXX source code dependencies Pull requests that update a dependency file upstream Something related to upstream projects

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants