Skip to content

Select Numpy C API version#534

Open
mattiapenati wants to merge 3 commits intoPyO3:mainfrom
mattiapenati:api-version
Open

Select Numpy C API version#534
mattiapenati wants to merge 3 commits intoPyO3:mainfrom
mattiapenati:api-version

Conversation

@mattiapenati
Copy link
Contributor

This PR introduces the build configuration to select the target Numpy C API version and adjusts struct definitions to match the user selected version.

The default configuration has been chosen to match the setting in the first release of Numpy v2.

The only potentially breaking change is the new definition of PyUFuncObject. The struct PyUFuncObject has been updated to match the definition given in Numpy source. The previous definition matched the definition contained in documentation. I think the former is more accurate.

I understand that this PR is not small and that not all changes can be easily reviewed, it wasn't easy to put everything together either. If the PR is too large, I could split it into smaller changes. Anyway, I hope it will help improve the FFI.

@mattiapenati mattiapenati force-pushed the api-version branch 2 times, most recently from 6f02c65 to c29564a Compare February 24, 2026 22:38
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