1. 08 Aug, 2022 2 commits
  2. 05 Aug, 2022 1 commit
  3. 03 Aug, 2022 1 commit
  4. 01 Aug, 2022 4 commits
  5. 29 Jul, 2022 1 commit
  6. 27 Jul, 2022 1 commit
  7. 22 Jul, 2022 1 commit
  8. 21 Jul, 2022 2 commits
    • More systematic gcc & clang coverage (#4083) · 9a296373
      * More systematic gcc coverage, based on https://github.com/pybind/pybind11/pull/4074#issuecomment-1188385580
      
      * Fix complete fail.
      
      * Resolve GCC 11 & 12 "redundant move in return statement" warnings.
      
      * Also add clang 11, 12, 13 (to gather info for warning suppressions).
      
      * Add & use `PYBIND11_DETECTED_CLANG_WITH_MISLEADING_CALL_STD_MOVE_EXPLICITLY_WARNING`
      Ralf W. Grosse-Kunstleve committed
    • For PyPy only, re-enable old behavior (runs the risk of masking bugs) (#4079) · cb35a3c1
      * For PyPy only, re-enable old behavior (likely to mask bugs), to avoid segfault with unknown root cause.
      
      Change prompted by https://github.com/pybind/pybind11/issues/4075
      
      * Undo the change in tests/test_exceptions.py
      
      I turns out (I forgot) that PyPy segfaults in `test_flaky_exception_failure_point_init` already before the `MISMATCH` code path is reached:
      
      https://github.com/pybind/pybind11/runs/7383663596
      
      ```
      RPython traceback:
      test_exceptions.py .......X.........Error in cpyext, CPython compatibility layer:
        File "pypy_module_cpyext.c", line 14052, in wrapper_second_level__star_3_1
        File "pypy_module_cpyext_1.c", line 35750, in not_supposed_to_fail
      Fatal Python error: Segmentation fault
      Stack (most recent call first, approximate line numbers):
        File "/home/runner/work/pybind11/pybind11/tests/test_exceptions.py", line 306 in test_flaky_exception_failure_point_init
      The function PyErr_NormalizeException was not supposed to fail
        File "/opt/hostedtoolcache/PyPy/3.7.13/x64/site-packages/_pytest/python.py", line 185 in pytest_pyfunc_call
        File "/opt/hostedtoolcache/PyPy/3.7.13/x64/site-packages/pluggy/_callers.py", line 9 in _multicall
        File "/opt/hostedtoolcache/PyPy/3.7.13/x64/site-packages/pluggy/_manager.py", line 77 in _hookexec
        File "/opt/hostedtoolcache/PyPy/3.7.13/x64/site-packages/pluggy/_hooks.py", line 244 in __call__
        File "/opt/hostedtoolcache/PyPy/3.7.13/x64/site-packages/_pytest/python.py", line 1716 in runtest
        File "/opt/hostedtoolcache/PyPy/3.7.13/x64/site-packages/_pytest/runner.py", line 159 in pytest_runtest_call
        File "/opt/hostedtoolcache/PyPy/3.7.13/x64/site-packages/pluggy/_callers.py", line 9 in _multicall
        File "/opt/hostedtoolcache/PyPy/3.7.13/x64/site-packages/pluggy/_manager.py", line 77 in _hookexec
      Fatal error in cpyext, CPython compatibility layer, calling PyErr_NormalizeException
      Either report a bug or consider not using this particular extension
      <SystemError object at 0x7fcc8cea6868>
        File "/opt/hostedtoolcache/PyPy/3.7.13/x64/site-packages/pluggy/_hooks.py", line 244 in __call__
        File "/opt/hostedtoolcache/PyPy/3.7.13/x64/site-packages/_pytest/runner.py", line 261 in <lambda>
        File "/opt/hostedtoolcache/PyPy/3.7.13/x64/site-packages/_pytest/runner.py", line 317 in from_call
        File "/opt/hostedtoolcache/PyPy/3.7.13/x64/site-packages/_pytest/runner.py", line 246 in call_runtest_hook
        File "/opt/hostedtoolcache/PyPy/3.7.13/x64/site-packages/_pytest/runner.py", line 218 in call_and_report
        File "/opt/hostedtoolcache/PyPy/3.7.13/x64/site-packages/_pytest/runner.py", line 118 in runtestprotocol
        File "/opt/hostedtoolcache/PyPy/3.7.13/x64/site-packages/_pytest/runner.py", line 110 in pytest_runtest_protocol
        File "/opt/hostedtoolcache/PyPy/3.7.13/x64/site-packages/pluggy/_callers.py", line 9 in _multicall
        File "/opt/hostedtoolcache/PyPy/3.7.13/x64/site-packages/pluggy/_manager.py", line 77 in _hookexec
        File "/opt/hostedtoolcache/PyPy/3.7.13/x64/site-packages/pluggy/_hooks.py", line 244 in __call__
        File "/opt/hostedtoolcache/PyPy/3.7.13/x64/site-packages/_pytest/main.py", line 335 in pytest_runtestloop
        File "/opt/hostedtoolcache/PyPy/3.7.13/x64/site-packages/pluggy/_callers.py", line 9 in _multicall
        File "/opt/hostedtoolcache/PyPy/3.7.13/x64/site-packages/pluggy/_manager.py", line 77 in _hookexec
        File "/opt/hostedtoolcache/PyPy/3.7.13/x64/site-packages/pluggy/_hooks.py", line 244 in __call__
        File "/opt/hostedtoolcache/PyPy/3.7.13/x64/site-packages/_pytest/main.py", line 318 in _main
        File "/opt/hostedtoolcache/PyPy/3.7.13/x64/site-packages/_pytest/main.py", line 255 in wrap_session
        File "/opt/hostedtoolcache/PyPy/3.7.13/x64/site-packages/_pytest/main.py", line 314 in pytest_cmdline_main
        File "/opt/hostedtoolcache/PyPy/3.7.13/x64/site-packages/pluggy/_callers.py", line 9 in _multicall
        File "/opt/hostedtoolcache/PyPy/3.7.13/x64/site-packages/pluggy/_manager.py", line 77 in _hookexec
        File "/opt/hostedtoolcache/PyPy/3.7.13/x64/site-packages/pluggy/_hooks.py", line 244 in __call__
        File "/opt/hostedtoolcache/PyPy/3.7.13/x64/site-packages/_pytest/config/__init__.py", line 133 in main
        File "/opt/hostedtoolcache/PyPy/3.7.13/x64/site-packages/_pytest/config/__init__.py", line 181 in console_main
        File "/opt/hostedtoolcache/PyPy/3.7.13/x64/site-packages/pytest/__main__.py", line 1 in <module>
        File "/opt/hostedtoolcache/PyPy/3.7.13/x64/lib-python/3/runpy.py", line 62 in _run_code
        File "/opt/hostedtoolcache/PyPy/3.7.13/x64/lib-python/3/runpy.py", line 170 in _run_module_as_main
        File "<builtin>/app_main.py", line 109 in run_toplevel
        File "<builtin>/app_main.py", line 652 in run_command_line
        File "<builtin>/app_main.py", line 996 in entry_point
      Segmentation fault (core dumped)
      ```
      
      * Add test_pypy_oserror_normalization
      
      * Disable new `PYPY_VERSION` `#if`, to verify that the new test actually fails.
      
      * Restore PYPY_VERSION workaround and update comment to reflect what was learned.
      
      * [ci skip] Fix trivial oversight in comment.
      Ralf W. Grosse-Kunstleve committed
  9. 20 Jul, 2022 2 commits
    • chore: use explicit defaulting in pyobject macros (#4017) · 42b54507
      * Use equals default in pyobject macros
      
      * Remove extra semicolon
      
      * Update clang-tidy equals-default rule to not ignore macros
      
      * Fix formatting
      
      * One last formatting change
      Aaron Gokaslan committed
    • Fix #3812 and fix const of inplace assignments (#4065) · f47f1edf
      * Fix #3812 and fix const of inplace assignments
      
      * Fix missing tests
      
      * Revert operator overloading changes
      
      * calculate answer first for tests
      
      * Simplify tests
      
      * Add more tests
      
      * Add a couple more tests
      
      * Add test_inplace_lshift, test_inplace_rshift for completeness.
      
      * Update tests
      
      * Shortcircuit on self assigment and address reviewer comment
      
      * broaden skip for self assignment
      
      * One more reviewer comment
      
      * Document opt behavior and make consistent
      
      * Revert unnecessary change
      
      * Clarify comment
      
      Co-authored-by: Ralf W. Grosse-Kunstleve <rwgk@google.com>
      Aaron Gokaslan committed
  10. 19 Jul, 2022 1 commit
  11. 16 Jul, 2022 3 commits
  12. 15 Jul, 2022 2 commits
  13. 14 Jul, 2022 1 commit
    • Disable implicit conversion of `0` to `pybind11::handle`. (#4008) · 1d811910
      * Disable implicit conversion from `0` to `pybind11::handle`.
      
      * Reverse or-ed condition in an attempt to resolve GCC 8.3.0 errors (i386/debian:buster).
      
      * Trying the simpler `std::is_same<T, PyObject *>`
      
      * Add implicit_conversion_from_pytorch_THPObjectPtr_to_handle test.
      
      * Accommodate types with implicit conversions to `PyObject *`, other than `handle` & `handle` subclasses, or integral types.
      
      * Fix copy-paste mishap (picked wrong name).
      
      * Revamp SFINAE construct to actually fix the pytorch issue (already validated against pytorch proper).
      
      The first version of the reduced pytorch code was critically missing the move ctor. The first version of the accompanying test was meaningless.
      
      Note: It turns out the `!std::is_arithmetic<T>` condition is not needed: `int` is not in general implicitly convertible to `PyObject *`, only the literal `0` is.
      
      * Use `NOLINT(performance-noexcept-move-constructor)` for reduced code from the wild (rather than changing the code).
      
      * Use any_of, all_of, negation. It turns out to clang-format nicer.
      
      * Clean up comments for changed code.
      
      * Reduce pytorch situation further, add test for operator ... const.
      
      * Use `none_of` as suggested by @skylion007
      
      * Add `pure_compile_tests_for_handle_from_PyObject_pointers()`
      
      * Fix inconsequential oversight (retested).
      
      * Factor our `is_pyobj_ptr_or_nullptr_t` to make the SFINAE conditions more readable.
      
      * Remove stray line (oversight).
      
      * Make the `pure_compile_tests_for_handle_from_PyObject_pointers()` "rhs-const-complete", too.
      
      * Remove the temporary PYBIND11_UNDO_PR4008 `#ifdef`.
      Ralf W. Grosse-Kunstleve committed
  14. 13 Jul, 2022 3 commits
  15. 12 Jul, 2022 2 commits
  16. 10 Jul, 2022 1 commit
  17. 08 Jul, 2022 2 commits
  18. 06 Jul, 2022 3 commits
    • docs: update changelog (#4042) · 0ab1fcfb
      Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
      Henry Schreiner committed
    • Fix: 3.11 beta support (#3923) · 2af163d9
      * Placeholder commit for 3.11 testing
      
      * Does this fix it?
      
      * Try suggestion
      
      * Placeholder commit for 3.11 testing
      
      * Does this fix it?
      
      * Try suggestion
      
      * fix: try using modern init for embedded interp
      
      Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
      
      * fix: error message changed in 3.11
      
      * fix: apply logic in Python manually
      
      Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
      
      * fix autodetect dynamic attrs in 3.11
      
      * fix: include error message if possible in error
      
      Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
      
      * ci: enable standard Python 3.11 testing
      
      Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
      
      * Make dynamic attrs condtiion exclusive to ver.
      
      Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
      Aaron Gokaslan committed
  19. 05 Jul, 2022 1 commit
  20. 04 Jul, 2022 2 commits
  21. 29 Jun, 2022 1 commit
    • Fix arrays with zero-size dimensions (#4038) · 479e9a50
      When converting an array to an Eigen matrix, ignore the strides if any
      dimension size is 0. If the array is empty, the strides aren't relevant,
      and especially numpy ≥ 1.23 explicitly sets the strides to 0 in this
      case. (See numpy commit dd5ab7b11520.)
      
      Update tests to verify that this works, and continues to work.
      Matthew Woehlke committed
  22. 28 Jun, 2022 1 commit
  23. 27 Jun, 2022 1 commit
  24. 21 Jun, 2022 1 commit