1. Apr 14, 2022
    • Oleksandr Pavlyk's avatar
      Adds set_name method of pybind11::capsule class (#3866) · fa98804a
      Oleksandr Pavlyk authored
      * Adds set_name method of pybind11::capsule class
      
      This calls PyCapsule_SetName on the underlying capsule object.
      
      modified destructors to query capsules's Name
      
      [pre-commit.ci] auto fixes from pre-commit.com hooks
      
      for more information, see https://pre-commit.ci
      
      Handle possible exception thrown by PyCapsule_GetName
      
      Also removed accidentally reintroduced use of `const char *&`.
      
      [pre-commit.ci] auto fixes from pre-commit.com hooks
      
      for more information, see https://pre-commit.ci
      
      Fixed function name
      
      * Introduced private static function to reuse get_name_or_throw
      
      * added tests for capsule renaming
      
      * [pre-commit.ci] auto fixes from pre-commit.com hooks
      
      for more information, see https://pre-commit.ci
      
      * handle python error in flight
      
      * [pre-commit.ci] auto fixes from pre-commit.com hooks
      
      for more information, see https://pre-commit.ci
      
      * Initialized PyObject * variables to nullptr
      
      * use write-unraisable if PyCapsule_GetName raises
      
      * [pre-commit.ci] auto fixes from pre-commit.com hooks
      
      for more information, see https://pre-commit.ci
      
      
      
      * get_name_or_throw->get_name_no_throw
      
      If PyCapsule_GetName raises an error we should write as unraisable
      to consume it and notify user, and then restore the error in flight if any.
      This way this method called from destructor would not modify interpreter
      error state.
      
      * used error_scope struct
      
      * Renamed get_name_no_throw->get_name_in_error_scope
      
      Co-authored-by: default avatarpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
      fa98804a
  2. Apr 12, 2022
  3. Apr 06, 2022
    • Aaron Gokaslan's avatar
      perf: Add more moves and optimize (#3845) · c4e29528
      Aaron Gokaslan authored
      * Make slice constructor consistent
      
      * Add more missing std::move for ref steals
      
      * Add missing perfect forwarding for arg_v ctor
      
      * Add missing move in arg_v constructor
      
      * Revert "Add missing move in arg_v constructor"
      
      This reverts commit 126fc7c524ea7a51b54720defd75de3470d69557.
      
      * Add another missing move in cast.h
      
      * Optimize object move ctor
      
      * Don't do useless move
      
      * Make move ctor same as nb
      
      * Make obj move ctor same as nb
      
      * Revert changes which break MSVC
      c4e29528
  4. Apr 05, 2022
  5. Apr 01, 2022
  6. Mar 31, 2022
  7. Mar 29, 2022
  8. Mar 26, 2022
  9. Mar 25, 2022
  10. Mar 22, 2022
  11. Mar 19, 2022
  12. Mar 18, 2022
  13. Mar 15, 2022
  14. Mar 12, 2022
  15. Mar 11, 2022
  16. Mar 03, 2022
  17. Mar 02, 2022
    • Stefano Rivera's avatar
      Use sysconfig in Python >= 3.10 (#3764) · 465b2e0b
      Stefano Rivera authored
      * Use sysconfig in Python >= 3.10
      
      Rely on sysconfig for installation paths for Python >= 3.10. distutils
      has been deprecated and will be removed.
      
      Fixes: #3677
      
      * Explicitly select the posix_prefix scheme for platinclude on Debian
      
      Debian's default scheme is posix_local, for installing locally-built
      packages to /usr/local/.  We want to find the Python headers in /usr/,
      so search posix_prefix.
      465b2e0b
    • Henry Schreiner's avatar
      ci: fix PyPy (#3768) · 5f9b090a
      Henry Schreiner authored
      * chore: minor fixes for newer PyPys
      
      * ci: fix issue with PyPy
      5f9b090a
  18. Mar 01, 2022
  19. Feb 26, 2022
  20. Feb 24, 2022
  21. Feb 21, 2022
  22. Feb 19, 2022
    • Peter Hawkins's avatar
      Fix exception handling when pybind11::weakref() fails. (#3739) · 44596bc4
      Peter Hawkins authored
      
      
      * Clear Python error state if pybind11::weakref() fails.
      
      The weakref() constructor calls pybind11_fail() without clearing any
      Python interpreter error state. If a client catches the C++ exception
      thrown by pybind11_fail(), the Python interpreter will be left in an
      error state.
      
      * Add test case for failing to create weakref
      
      * Add Debug asserts for pybind11 fail
      
      * Make error handling more pythonic
      
      * Does this fix PyPy?
      
      * Adapt test to PyPy differences
      
      * Simplify test to remove redundancy
      
      Co-authored-by: default avatarAaron Gokaslan <skylion.aaron@gmail.com>
      44596bc4
  23. Feb 16, 2022