1. 18 Jun, 2024 2 commits
  2. 17 Jun, 2024 1 commit
  3. 15 Jun, 2024 2 commits
    • Add type[T] support to typing.h (#5166) · 7c4ac91d
      * add type[T]
      
      * style: pre-commit fixes
      
      * fix merge
      
      ---------
      
      Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
      Michael Carlstrom committed
    • Add `Union` and `Optional` to typing.h (#5165) · 68405a11
      * add type unions and optionals
      
      * add type inheritance
      
      * style: pre-commit fixes
      
      * switch to inheriting from object
      
      * style: pre-commit fixes
      
      * fix text case
      
      * style: pre-commit fixes
      
      * fix bind call
      
      * fix function name
      
      * add std::move for older code
      
      * remove std::move
      
      * move away from object creation
      
      * style: pre-commit fixes
      
      ---------
      
      Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
      Michael Carlstrom committed
  4. 11 Jun, 2024 1 commit
    • Fix refcount bug involving trampoline functions with `PyObject *` return type. (#5156) · ab955f15
      * 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.
      Ralf W. Grosse-Kunstleve committed
  5. 07 Jun, 2024 1 commit
  6. 06 Jun, 2024 2 commits
  7. 30 May, 2024 2 commits
  8. 28 May, 2024 2 commits
    • fix: Python 3.13t with GIL (#5139) · ae6432b8
      * ci: try Python 3.13t
      
      Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
      
      * fix: support Python 3.13t
      
      Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
      
      * fix: patch PyPy
      
      Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
      
      * tests: one more int cast
      
      Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
      
      * tests: cleanup
      
      Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
      
      * refactor: use named constant in tests for immortal refcounts
      
      Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
      
      * docs: move comment about free threaded Python
      
      Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
      
      ---------
      
      Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
      Henry Schreiner committed
    • fix: added check on iterator end position (#5129) · a5b9e50f
      * Added check on iterator end position
      
      * Always use assert without conditional check
      
      * Addressing code review comments
      
      * style: pre-commit fixes
      
      * Remove assert and throw
      
      * Changed style slightly
      
      ---------
      
      Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
      Cliff Burdick committed
  9. 27 May, 2024 1 commit
  10. 24 May, 2024 2 commits
    • fix: support Python 3.13.0b1 (PEP 667 fix) (#5127) · 4d0fcedc
      * ci: add Python 3.13
      
      Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
      
      * tests: run the gc for 3.13+
      
      Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
      
      * Revert "tests: run the gc for 3.13+"
      
      This reverts commit fe8a3ce3d133f69582e8244b737456ff57559e55.
      
      * ci: drop macos ARM for now, need pin updates
      
      Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
      
      * fix: use Python 3.13 API if on 3.13
      
      Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
      
      ---------
      
      Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
      Henry Schreiner committed
  11. 23 May, 2024 1 commit
    • --- (#5130) · b07fddb2
      updated-dependencies:
      - dependency-name: requests
        dependency-type: indirect
      ...
      
      Signed-off-by: dependabot[bot] <support@github.com>
      Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
      dependabot[bot] committed
  12. 10 May, 2024 2 commits
  13. 06 May, 2024 5 commits
  14. 09 Apr, 2024 1 commit
  15. 02 Apr, 2024 1 commit
  16. 28 Mar, 2024 2 commits
  17. 27 Mar, 2024 5 commits
  18. 26 Mar, 2024 2 commits
    • feat: make `numpy.h` compatible with both NumPy 1.x and 2.x (#5050) · 705efcce
      * 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>
      Sebastian Berg committed
    • tests: hide warning on clang (#5069) · e0f2c715
      Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
      Henry Schreiner committed
  19. 21 Mar, 2024 3 commits
  20. 14 Feb, 2024 1 commit
  21. 13 Feb, 2024 1 commit