1. Jun 12, 2024
    • Ralf W. Grosse-Kunstleve's avatar
      Fix refcount bug involving trampoline functions with `PyObject *` return type. (#5156) · ab955f15
      Ralf W. Grosse-Kunstleve authored
      * Transfer diff from pybind11k fork as-is. New tests are still missing.
      
      * Add `PYBIND11_WARNING_DISABLE_MSVC(4127)` into `PYBIND11_OVERRIDE_IMPL` macro.
      
      * Add test_trampoline_with_pyobject_ptr_return()
      
      * Resolve clang-tidy error: use auto when initializing with a template cast to avoid duplicating the type name [modernize-use-auto,-warnings-as-errors]
      
      * Disabled checking refcount when building with PyPy.
      
      * Clang 3.6, 3.7, 3.9 compatibility.
      
      ```
      /__w/pybind11/pybind11/tests/test_type_caster_pyobject_ptr.cpp:23:13: error: definition of implicit copy constructor for 'WithPyObjectPtrReturn' is deprecated because it has a user-declared destructor [-Werror,-Wdeprecated]
          virtual ~WithPyObjectPtrReturn() = default;
                  ^
      ```
      
      * Minor clean-up of production code changes.
      
      * Add missing `override` (to resolve clang-tidy error).
      
      * Move PYBIND11_WARNING_POP for a better clang-format outcome.
      ab955f15
  2. Jun 08, 2024
  3. Jun 07, 2024
  4. May 30, 2024
  5. May 28, 2024
  6. May 25, 2024
  7. May 24, 2024
  8. May 23, 2024
  9. May 11, 2024
  10. May 07, 2024
  11. Apr 10, 2024
  12. Apr 02, 2024
  13. Mar 28, 2024
  14. Mar 27, 2024
    • Sebastian Berg's avatar
      feat: make `numpy.h` compatible with both NumPy 1.x and 2.x (#5050) · 705efcce
      Sebastian Berg authored
      
      
      * 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: default avatarHenry Schreiner <henryschreineriii@gmail.com>
      
      ---------
      
      Signed-off-by: default avatarHenry Schreiner <henryschreineriii@gmail.com>
      Co-authored-by: default avatarRalf W. Grosse-Kunstleve <rwgk@google.com>
      Co-authored-by: default avatarHenry Schreiner <henryschreineriii@gmail.com>
      705efcce
    • Henry Schreiner's avatar
      e0f2c715
  15. Mar 21, 2024
  16. Feb 14, 2024
  17. Feb 06, 2024
  18. Jan 29, 2024
  19. Jan 17, 2024
  20. Jan 14, 2024