pybind11/.github
Sebastian Berg 705efccecd
feat: make `numpy.h` compatible with both NumPy 1.x and 2.x (#5050)
* API: Make `numpy.h` compatible with both NumPy 1.x and 2.x

* TST: Update numpy dtype flags test to not covert flags to char

* API: Add `numpy2.h` instead and make `numpy.h` safe

This means that users of `numpy.h` cannot be broken, but need to
update to `numpy2.h` if they want to compile for NumPy 2.

Using Macros simply and didn't bother to try to remove unnecessary
code paths.

* API: Rather than `numpy2.h` use a define for the user.

* Thread `PYBIND11_NUMPY2_SUPPORT` through things and try to adept test matrix

* Small fixups (shouldn't matter)?

* Fixup.  Does upgrading scipy help?  (it shouldn't?)

(Some other small fixup)

* Use NumPy 2 nightlies for ubuntu-latest job also

* BUG: Fix numpy.bool check

* TST: Fix complexwarning

* BUG: Fix the fact that only the 50 slot is filled with the copy alias

(There were 3 functions all doing the same, only this slot survived 2.x)

* TST: One more test tweak

* TST: Use "long" name for long, since it changed on windows

* TST: Apparently we didn't always have ulong, so just use `L`

* TST: Enforce dtype='l' for test as default isn't long anymore on windows

* Rename macro and invert logic to PYBIND11_NUMPY_1_ONLY

* PYBIND11_INTERNAL_NUMPY_1_ONLY_DETECTED

* Test and code comment expansion

* CI: Use pre-releases of numpy/scipy from pip via explicit version

* CI: NumPy 2 only available on almalinux (as it is Python >=3.9)

* MAINT: Match name more exactly and adopt error phrasing

* MAINT: Pushed early, move helper to be private member

* fix error message compilation when using NumPy 1.x-only backcompat

* silence name shadowing warning

* chore: minor optimization

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: Ralf W. Grosse-Kunstleve <rwgk@google.com>
Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
2024-03-26 18:20:11 -04:00
..
ISSUE_TEMPLATE fix(.github): fix bug-report issue template (#4363) 2022-11-25 15:15:54 -08:00
matchers style: pylint (#3720) 2022-02-15 17:48:33 -05:00
workflows feat: make `numpy.h` compatible with both NumPy 1.x and 2.x (#5050) 2024-03-26 18:20:11 -04:00
CODEOWNERS chore: add nox support (#3101) 2021-07-12 17:45:40 -04:00
CONTRIBUTING.md chore(deps): update pre-commit hooks (#4868) 2023-10-03 13:13:44 -04:00
dependabot.yml ci: ignore actions/checkout until v5 comes out 2024-02-13 18:36:39 -05:00
labeler.yml ci: original labeler 2020-10-12 22:35:23 -04:00
labeler_merged.yml ci: original labeler 2020-10-12 22:35:23 -04:00
pull_request_template.md docs: mention title conventions in PR template (#3313) 2021-09-29 06:18:58 -04:00