1. 19 Jan, 2023 1 commit
  2. 14 Jan, 2023 1 commit
  3. 02 Jan, 2023 1 commit
  4. 20 Dec, 2022 1 commit
  5. 09 Dec, 2022 2 commits
    • aimir's avatar
      Correct class names for KeysView, ValuesView and ItemsView in bind_map (#4353) · 9db98801
      aimir authored
      
      
      * Create templated abstract classes KeysView, ValuesView and ItemsView, and implement them on-the-fly when wrapping any specific map type
      
      * We don't want to wrap different ValuesView objects for double values and const double, for example, as both wrappers will be named ValuesView[float]
      
      * Fallback to C++ names if key or values types are not wrapped
      
      * Added a test for .keys(), .values() and .items() returning the same types for similarly-typed maps
      
      * Fixed wrong use of auto in a declarator list: the two descriptions might have different types
      
      * Fixes for clang-tidy issues: explicit single-argument constructor, using the 'override' keyword when overriding functions
      
      * Bugfix for old versions of clang++, which seem to have trouble with the struct being defined inside a module, which was also needlessly ugly anyway
      
      * Bugfix for clang++, which doesn't have some of the names in runtime uness they are specified to be static
      
      * A fix for clang-tidy performance-inefficient-string-concatenation issues - I personally think this looks uglier, but it's probably worth it for clang-tidy to be happy
      
      * Possible fix for clang++ linking issues - make the descriptions static constexpr to make sure they are known before linking
      
      * Correct names for previously-wrapped types as keys/values of maps
      
      * Bugfix - typo in type info names which caused things to segfault
      
      * Apply suggestions from code review
      Co-authored-by: default avatarAaron Gokaslan <skylion.aaron@gmail.com>
      
      * Use detail::remove_cvref_t instead of doing remove_cv and remove_reference separately
      
      * Avoid names with double underscore, as they are reserved
      
      * Improved testing for KeysView, ValuesView and ItemsView: check type names + stricter asserts
      
      * Moved description logic to helper function in type_caster_base.h
      
      * style: pre-commit fixes
      
      * Fix a clang-tidy issue: do not use 'else' after 'return'
      
      * Apply suggestion by @Skylion007, with additional trivial simplification.
      Co-authored-by: default avatarAmir <aimir@local>
      Co-authored-by: default avataraimir <aimir@localhost>
      Co-authored-by: default avatarAaron Gokaslan <skylion.aaron@gmail.com>
      Co-authored-by: default avatarpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
      Co-authored-by: default avatarRalf W. Grosse-Kunstleve <rwgk@google.com>
      9db98801
    • Frank's avatar
      Add option for enable/disable enum members in docstring. (#2768) · 00126859
      Frank authored
      
      
      * Add option for enable/disable enum members in docstring
      
      * Add tests for disable enum members docstring option
      
      * Add docstring options to documentation
      
      * style: pre-commit fixes
      
      * Fix typos in documentation
      
      * Improve documentation wording
      
      * Apply suggestions by @Skylion007
      Co-authored-by: default avatarpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
      Co-authored-by: default avatarRalf W. Grosse-Kunstleve <rwgk@google.com>
      00126859
  6. 06 Dec, 2022 1 commit
  7. 01 Dec, 2022 3 commits
    • Aaron Gokaslan's avatar
      chore: Convert direct multiprocessing.set_start_method("forkserver") call to a... · e133c33d
      Aaron Gokaslan authored
      chore: Convert direct multiprocessing.set_start_method("forkserver") call to a pytest fixture. (#4377)
      
      * chore: convert multiprocessing set_spawn to fixture in pytest
      
      * Switch to early return
      e133c33d
    • Ralf W. Grosse-Kunstleve's avatar
      358ba459
    • Arman's avatar
      scoped_interpreter. overloaded constructor: PyConfig param (#4330) · 88699849
      Arman authored
      
      
      * scoped_interpreter overloaded ctor: PyConfig param
      
      * style: pre-commit fixes
      
      * refact: some logics extracted into funcs (precheck_interpreter, _initialize_interpreter); config_guard
      
      * style: pre-commit fixes
      
      * refact: scoped_config, some funcs hidden in detail ns
      
      * refact: macro PYBIND11_PYCONFIG_SUPPORT_PY_VERSION + undef
      
      * feat: PYBIND11_PYCONFIG_SUPPORT_PY_VERSION set to 3.8
      
      * tests: Custom PyConfig
      
      * ci: python 3.6 -> 3.8
      
      * ci: reverted py 38 back  to 36; refact: initialize_interpreter overloads
      
      * style: pre-commit fixes
      
      * fix: readability-implicit-bool-conversion
      
      * refact: each initialize_interpreter overloads in pybind11 ns
      
      * Move `initialize_interpreter_pre_pyconfig()` into the `detail` namespace.
      
      Move the `PYBIND11_PYCONFIG_SUPPORT_PY_VERSION_HEX` define down to where it is used for the first time, and check if it is defined already, so that it is possible to customize from the compilation command line, just in case there is some unforeseen issue for Python 3.8, 3.9, 3.10.
      
      * tests: Add program dir to path, Custom PyConfig with argv
      
      * refact: clang-formatted
      
      * tests: Add-program-dir-to-path covers both scoped_interpreter overloads
      
      * tests: Add-program-dir-to-path fixed
      
      * tests: Add-program-dir-to-path py_version dependant validation
      Co-authored-by: default avatarpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
      Co-authored-by: default avatarRalf W. Grosse-Kunstleve <rwgk@google.com>
      88699849
  8. 28 Nov, 2022 1 commit
  9. 23 Nov, 2022 1 commit
    • Ralf W. Grosse-Kunstleve's avatar
      Use `multiprocessing` `start_method` `"forkserver"` (#4306) · 9c18a74e
      Ralf W. Grosse-Kunstleve authored
      * Use `multiprocessing` `start_method` `"forkserver"`
      
      Alternative to PR #4305
      
      * Add link to comment under PR #4105
      
      * Unconditionally `pytest.skip("DEADLOCK")` for PyPy Windows
      
      * Remove `SKIP_IF_DEADLOCK` entirely, for simplicity. Hopefully this PR will resolve the deadlocks for good.
      
      * Add "In a nutshell" comment, in response to request by @EricCousineau-TRI
      9c18a74e
  10. 12 Nov, 2022 1 commit
  11. 02 Nov, 2022 1 commit
    • Ethan Steinberg's avatar
      Fix functional.h bug + introduce test to verify that it is fixed (#4254) · ee2b5226
      Ethan Steinberg authored
      
      
      * Illustrate bug in functional.h
      
      * style: pre-commit fixes
      
      * Make functional casting more robust / add workaround
      
      * Make function_record* casting even more robust
      
      * See if this fixes PyPy issue
      
      * It still fails on PyPy sadly
      
      * Do not make new CTOR just yet
      
      * Fix test
      
      * Add name to ensure correctness
      
      * style: pre-commit fixes
      
      * Clean up tests + remove ifdef guards
      
      * Add comments
      
      * Improve comments, error handling, and safety
      
      * Fix compile error
      
      * Fix magic logic
      
      * Extract helper function
      
      * Fix func signature
      
      * move to local internals
      
      * style: pre-commit fixes
      
      * Switch to simpler design
      
      * style: pre-commit fixes
      
      * Move to function_record
      
      * style: pre-commit fixes
      
      * Switch to internals, update tests and docs
      
      * Fix lint
      
      * Oops, forgot to resolve last comment
      
      * Fix typo
      
      * Update in response to comments
      
      * Implement suggestion to improve test
      
      * Update comment
      
      * Simple fixes
      Co-authored-by: default avatarpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
      Co-authored-by: default avatarAaron Gokaslan <aaronGokaslan@gmail.com>
      ee2b5226
  12. 31 Oct, 2022 1 commit
  13. 30 Oct, 2022 2 commits
    • Ralf W. Grosse-Kunstleve's avatar
    • Chekov2k's avatar
      Add `PYBIND11_SIMPLE_GIL_MANAGEMENT` option (cmake, C++ define) (#4216) · b07d08f6
      Chekov2k authored
      * Add option to force the use of the PYPY GIL scoped acquire/release logic to support nested gil access, see https://github.com/pybind/pybind11/issues/1276 and https://github.com/pytorch/pytorch/issues/83101
      
      
      
      * Apply suggestions from code review
      
      * Update CMakeLists.txt
      
      * docs: update upgrade guide
      
      * Update docs/upgrade.rst
      
      * All bells & whistles.
      
      * Add Reminder to common.h, so that we will not forget to purge `!WITH_THREAD` branches when dropping Python 3.6
      
      * New sentence instead of semicolon.
      
      * Temporarily pull in snapshot of PR #4246
      
      * Add `test_release_acquire`
      
      * Add more unit tests for nested gil locking
      
      * Add test_report_builtins_internals_keys
      
      * Very minor enhancement: sort list only after filtering.
      
      * Revert change in docs/upgrade.rst
      
      * Add test_multi_acquire_release_cross_module, while also forcing unique PYBIND11_INTERNALS_VERSION for cross_module_gil_utils.cpp
      
      * Hopefully fix apparently new ICC error.
      
      ```
      2022-10-28T07:57:54.5187728Z -- The CXX compiler identification is Intel 2021.7.0.20220726
      ...
      2022-10-28T07:58:53.6758994Z icpc: remark #10441: The Intel(R) C++ Compiler Classic (ICC) is deprecated and will be removed from product release in the second half of 2023. The Intel(R) oneAPI DPC++/C++ Compiler (ICX) is the recommended compiler moving forward. Please transition to use this compiler. Use '-diag-disable=10441' to disable this message.
      2022-10-28T07:58:54.5801597Z In file included from /home/runner/work/pybind11/pybind11/include/pybind11/detail/../detail/type_caster_base.h(15),
      2022-10-28T07:58:54.5803794Z                  from /home/runner/work/pybind11/pybind11/include/pybind11/detail/../cast.h(15),
      2022-10-28T07:58:54.5805740Z                  from /home/runner/work/pybind11/pybind11/include/pybind11/detail/../attr.h(14),
      2022-10-28T07:58:54.5809556Z                  from /home/runner/work/pybind11/pybind11/include/pybind11/detail/class.h(12),
      2022-10-28T07:58:54.5812154Z                  from /home/runner/work/pybind11/pybind11/include/pybind11/pybind11.h(13),
      2022-10-28T07:58:54.5948523Z                  from /home/runner/work/pybind11/pybind11/tests/cross_module_gil_utils.cpp(13):
      2022-10-28T07:58:54.5949009Z /home/runner/work/pybind11/pybind11/include/pybind11/detail/../detail/internals.h(177): error #2282: unrecognized GCC pragma
      2022-10-28T07:58:54.5949374Z       PYBIND11_TLS_KEY_INIT(tstate)
      2022-10-28T07:58:54.5949579Z       ^
      2022-10-28T07:58:54.5949695Z
      ```
      
      * clang-tidy fixes
      
      * Workaround for PYPY WIN exitcode None
      
      * Revert "Temporarily pull in snapshot of PR #4246"
      
      This reverts commit 23ac16e859150f27fda25ca865cabcb4444e0770.
      
      * Another workaround for PYPY WIN exitcode None
      
      * Clean up how the tests are run "run in process" Part 1: uniformity
      
      * Clean up how the tests are run "run in process" Part 2: use `@pytest.mark.parametrize` and clean up the naming.
      
      * Skip some tests `#if defined(THREAD_SANITIZER)` (tested with TSAN using the Google-internal toolchain).
      
      * Run all tests again but ignore ThreadSanitizer exitcode 66 (this is less likely to mask unrelated ThreadSanitizer issues in the future).
      
      * bug fix: missing common.h include before using `PYBIND11_SIMPLE_GIL_MANAGEMENT`
      
      For the tests in the github CI this does not matter, because
      `PYBIND11_SIMPLE_GIL_MANAGEMENT` is always defined from the command line,
      but when monkey-patching common.h locally, it matters.
      
      * if process.exitcode is None: assert t_delta > 9.9
      
      * More sophisiticated `_run_in_process()` implementation, clearly reporting `DEADLOCK`, additionally exercised via added `intentional_deadlock()`
      
      * Wrap m.intentional_deadlock in a Python function, for `ForkingPickler` compatibility.
      
      ```
      >       ForkingPickler(file, protocol).dump(obj)
      E       TypeError: cannot pickle 'PyCapsule' object
      ```
      
      Observed with all Windows builds including mingw but not PyPy, and macos-latest with Python 3.9, 3.10, 3.11 but not 3.6.
      
      * Add link to potential solution for WOULD-BE-NICE-TO-HAVE feature.
      
      * Add `SKIP_IF_DEADLOCK = True` option, to not pollute the CI results with expected `DEADLOCK` failures while we figure out what to do about them.
      
      * Add COPY-PASTE-THIS: gdb ... command (to be used for debugging the detected deadlock)
      
      * style: pre-commit fixes
      
      * Do better than automatic pre-commit fixes.
      
      * Add `PYBIND11_SIMPLE_GIL_MANAGEMENT` to `pytest_report_header()` (so that we can easily know when harvesting deadlock information from the CI logs).
      Co-authored-by: default avatarArnim Balzer <arnim@seechange.ai>
      Co-authored-by: default avatarHenry Schreiner <HenrySchreinerIII@gmail.com>
      Co-authored-by: default avatarRalf W. Grosse-Kunstleve <rwgk@google.com>
      Co-authored-by: default avatarpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
      b07d08f6
  14. 29 Oct, 2022 1 commit
  15. 22 Oct, 2022 1 commit
  16. 21 Oct, 2022 2 commits
  17. 20 Oct, 2022 1 commit
  18. 18 Oct, 2022 1 commit
    • Lalaland's avatar
      First draft of Eigen::Tensor support (#4201) · fab1eebe
      Lalaland authored
      * First draft of Eigen::Tensor support
      
      * [pre-commit.ci] auto fixes from pre-commit.com hooks
      
      for more information, see https://pre-commit.ci
      
      * Fix build errors
      
      * Weird allocator stuff?
      
      * [pre-commit.ci] auto fixes from pre-commit.com hooks
      
      for more information, see https://pre-commit.ci
      
      * Remove unused + additional allocator junk
      
      * Disable warning
      
      * Use constexpr
      
      * [pre-commit.ci] auto fixes from pre-commit.com hooks
      
      for more information, see https://pre-commit.ci
      
      * clang tidy fixes
      
      * [pre-commit.ci] auto fixes from pre-commit.com hooks
      
      for more information, see https://pre-commit.ci
      
      * Resolve comments
      
      * [pre-commit.ci] auto fixes from pre-commit.com hooks
      
      for more information, see https://pre-commit.ci
      
      * Remove auto constexpr function
      
      * [pre-commit.ci] auto fixes from pre-commit.com hooks
      
      for more information, see https://pre-commit.ci
      
      * Try again for older C++
      
      * Oops forgot constexpr
      
      * Move to new files as suggested
      
      * [pre-commit.ci] auto fixes from pre-commit.com hooks
      
      for more information, see https://pre-commit.ci
      
      * Fix weird tests
      
      * Fix nits
      
      * [pre-commit.ci] auto fixes from pre-commit.com hooks
      
      for more information, see https://pre-commit.ci
      
      * Oops, forgot import
      
      * Fix clang 3.6 bug
      
      * [pre-commit.ci] auto fixes from pre-commit.com hooks
      
      for more information, see https://pre-commit.ci
      
      * More comprehensive test suite
      
      * [pre-commit.ci] auto fixes from pre-commit.com hooks
      
      for more information, see https://pre-commit.ci
      
      * Refactor allocators to make things more clear
      
      * [pre-commit.ci] auto fixes from pre-commit.com hooks
      
      for more information, see https://pre-commit.ci
      
      * Switch to std::copy
      
      * [pre-commit.ci] auto fixes from pre-commit.com hooks
      
      for more information, see https://pre-commit.ci
      
      * Switch to DSizes instead of array
      
      * [pre-commit.ci] auto fixes from pre-commit.com hooks
      
      for more information, see https://pre-commit.ci
      
      * Address feedback
      
      * [pre-commit.ci] auto fixes from pre-commit.com hooks
      
      for more information, see https://pre-commit.ci
      
      * Fix python + dummy c++ change to trigger build
      
      * [pre-commit.ci] auto fixes from pre-commit.com hooks
      
      for more information, see https://pre-commit.ci
      
      * Alignment
      
      * [pre-commit.ci] auto fixes from pre-commit.com hooks
      
      for more information, see https://pre-commit.ci
      
      
      
      * Add include guard
      
      * Forgot inline
      
      * Fix compiler warning
      
      * Remove bad test
      
      * Better type signatures
      
      * Add guards to make compiler requirements more explicit
      
      * style: pre-commit fixes
      
      * Force rerun of tests due to flake
      
      * style: pre-commit fixes
      
      * Keep pragmas & all related comments together, add PLEASE KEEP IN SYNC
      
      * Move headers out of detail
      
      * style: pre-commit fixes
      
      * Fix cmake
      
      * Improve casting
      
      * style: pre-commit fixes
      
      * Add a ton more tests + refactor
      
      * Improve names
      
      * style: pre-commit fixes
      
      * Update include/pybind11/eigen/tensor.h
      Co-authored-by: default avatarAaron Gokaslan <skylion.aaron@gmail.com>
      
      * Fix tests
      
      * style: pre-commit fixes
      
      * Update
      
      * Add a test to verify that strange numpy arrays work
      
      * Fix dumb compiler warning
      
      * Better tests
      
      * Better tests
      
      * Fix tests
      
      * style: pre-commit fixes
      
      * More test fixes
      
      * style: pre-commit fixes
      
      * A ton more test coverage
      
      * Fix tests
      
      * style: pre-commit fixes
      
      * style: pre-commit fixes
      
      * Add back constexpr
      
      * Another test
      
      * style: pre-commit fixes
      
      * Improve tests
      
      * Whoops
      
      * Less magic numbers
      
      * Update tests/test_eigen_tensor.py
      Co-authored-by: default avatarSergiu Deitsch <sergiud@users.noreply.github.com>
      
      * Update tests/test_eigen_tensor.py
      Co-authored-by: default avatarSergiu Deitsch <sergiud@users.noreply.github.com>
      
      * style: pre-commit fixes
      
      * Fix tests
      
      * style: pre-commit fixes
      
      * Fix memory leak
      
      * style: pre-commit fixes
      
      * Fix order
      
      * style: pre-commit fixes
      
      * Add test to make sure unsafe casts fail
      
      * Minor bug fix to work on 32 bit machines
      
      * Implement convert flag
      
      * style: pre-commit fixes
      
      * Switch to correct TensorMap const use
      
      * style: pre-commit fixes
      
      * Support older versions of eigen
      
      * Weird c++ compilers
      
      * Fix Eigen bug
      
      * Fix another eigen bug
      
      * Yet another eigen bug
      
      * Potential flakes?
      
      * style: pre-commit fixes
      
      * Rerun tests with dummy exception to find out what is going on
      
      * Another dummy test run
      
      * Ablate more
      
      * Found the broken test?
      
      * One step closer
      
      * one step further
      
      * Double check
      
      * one thing at a time
      
      * Give up and disable the test
      
      * Clang lies about being gcc
      
      * Oops, fix matrix test
      
      * style: pre-commit fixes
      
      * Add tests to verify scalar conversions
      
      * style: pre-commit fixes
      
      * Fix nits
      
      * Support no_array
      
      * Fix tests
      
      * style: pre-commit fixes
      
      * Silence compiler warning
      
      * Improve build system for ancient compilers
      
      * Make clang happy
      
      * Make gcc happy
      
      * Implement Skylion's suggestions
      
      * Fix warning
      
      * Inline const pointer check
      
      * Implement suggestions
      
      * style: pre-commit fixes
      
      * Improve tests
      
      * Typo
      
      * style: pre-commit fixes
      
      * Support Google's build environment
      
      * style: pre-commit fixes
      
      * Update include/pybind11/eigen/tensor.h
      Co-authored-by: default avatarAaron Gokaslan <skylion.aaron@gmail.com>
      
      * style: pre-commit fixes
      
      * Test cleanup per Skylion
      
      * Switch to remvove_cv_t
      
      * Cleaner test
      
      * style: pre-commit fixes
      
      * Remove tensor from eigen.h, update tests
      
      * style: pre-commit fixes
      Co-authored-by: default avatarpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
      Co-authored-by: default avatarRalf W. Grosse-Kunstleve <rwgk@google.com>
      Co-authored-by: default avatarAaron Gokaslan <aaronGokaslan@gmail.com>
      Co-authored-by: default avatarAaron Gokaslan <skylion.aaron@gmail.com>
      Co-authored-by: default avatarSergiu Deitsch <sergiud@users.noreply.github.com>
      fab1eebe
  19. 17 Oct, 2022 1 commit
    • Aaron Gokaslan's avatar
      bugfix: py contains raises errors when appropiate (#4209) · b926396b
      Aaron Gokaslan authored
      * bugfix: contains now throws an exception if the key is not hashable
      
      * Fix tests and improve robustness
      
      * Remove todo
      
      * Workaround PyPy corner case
      
      * PyPy xfail
      
      * Fix typo
      
      * fix xfail
      
      * Make clang-tidy happy
      
      * Remove redundant exc checking
      b926396b
  20. 10 Oct, 2022 1 commit
    • Ralf W. Grosse-Kunstleve's avatar
      Reproducer and fix for issue encountered in smart_holder update. (#4228) · da104a9e
      Ralf W. Grosse-Kunstleve authored
      * Reproducer for issue encountered in smart_holder update.
      
      * clang-tidy compatibility (untested).
      
      * Add `enable_if_t` to workaround.
      
      * Bug fix: Move `PYBIND11_USING_WORKAROUND_FOR_CUDA_11_4_THROUGH_8` determination to detail/common.h
      
      So that it actually is defined in pybind11.h
      
      * Try using the workaround (which is nicer than the original code) universally.
      
      * Reduce reproducer for CUDA 11.7 issue encountered in smart_holder update.
      
      This commit tested in isolation on top of current master + first version of reproducer (62311eb431849d135a5db84f6c75ec390f2ede7c).
      
      Succeeds with Debian Clang 14.0.6 C++17 (and probably all other compilers).
      
      Fails for CUDA 11.7:
      
      ```
      cd /build/tests && /usr/local/cuda/bin/nvcc -forward-unknown-to-host-compiler -Dpybind11_tests_EXPORTS -I/mounted_pybind11/include -isystem=/usr/include/python3.10 -g --generate-code=arch=compute_52,code=[compute_52,sm_52] -Xcompiler=-fPIC -Xcompiler=-fvisibility=hidden -Werror all-warnings -std=c++17 -MD -MT tests/CMakeFiles/pybind11_tests.dir/test_class.cpp.o -MF CMakeFiles/pybind11_tests.dir/test_class.cpp.o.d -x cu -c /mounted_pybind11/tests/test_class.cpp -o CMakeFiles/pybind11_tests.dir/test_class.cpp.o
      /mounted_pybind11/tests/test_class.cpp(53): error: more than one instance of overloaded function "pybind11::class_<type_, options...>::def [with type_=test_class::pr4220_tripped_over_this::Empty0, options=<>]" matches the argument list:
                  function template "pybind11::class_<test_class::pr4220_tripped_over_this::Empty0> &pybind11::class_<type_, options...>::def(const char *, Func &&, const Extra &...) [with type_=test_class::pr4220_tripped_over_this::Empty0, options=<>]"
      /mounted_pybind11/include/pybind11/pybind11.h(1557): here
                  function template "pybind11::class_<test_class::pr4220_tripped_over_this::Empty0> &pybind11::class_<type_, options...>::def(const T &, const Extra &...) [with type_=test_class::pr4220_tripped_over_this::Empty0, options=<>]"
      /mounted_pybind11/include/pybind11/pybind11.h(1586): here
                  argument types are: (const char [8], <unknown-type>)
                  object type is: pybind11::class_<test_class::pr4220_tripped_over_this::Empty0>
      
      1 error detected in the compilation of "/mounted_pybind11/tests/test_class.cpp".
      ```
      da104a9e
  21. 07 Oct, 2022 2 commits
  22. 30 Aug, 2022 1 commit
  23. 24 Aug, 2022 1 commit
    • Brad Messer's avatar
      Words matter updates (#4155) · a48ec3e8
      Brad Messer authored
      * Remove sanity check from code base.
      
      * Use main over master.
      
      * Better alternative that doesn't collide with language keywords/frequent usage words.
      a48ec3e8
  24. 21 Aug, 2022 1 commit
  25. 11 Aug, 2022 1 commit
  26. 09 Aug, 2022 1 commit
  27. 03 Aug, 2022 1 commit
  28. 01 Aug, 2022 2 commits
    • Thomas Eding's avatar
      f8e8403b
    • Ralf W. Grosse-Kunstleve's avatar
      Add `-DPYBIND11_WERROR=ON` to mingw cmake commands (#4073) · 36655302
      Ralf W. Grosse-Kunstleve authored
      * Add `-DPYBIND11_WERROR=ON` to mingw cmake commands (and `-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON`).
      
      * Using no-destructor idiom to side-step overzealous MINGW warning.
      
      * Add __MINGW32__ pragma GCC diagnostic ignored in eigen.h
      
      * Add another no-destructor workaround.
      
      * Temporarily add -k (keep-going) flags to hopefully speed up finding all warnings.
      
      * Revert "Temporarily add -k (keep-going) flags to hopefully speed up finding all warnings."
      
      This reverts commit f36b0af8f93e9f6f16c969fb5b646e116f5eaf0f.
      
      * Very minor shuffle to avoid MSVC warnings.
      
      * Remove all `:BOOL` as suggested by @henryiii
      36655302
  29. 21 Jul, 2022 2 commits
    • Ralf W. Grosse-Kunstleve's avatar
      More systematic gcc & clang coverage (#4083) · 9a296373
      Ralf W. Grosse-Kunstleve authored
      * 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`
      9a296373
    • Ralf W. Grosse-Kunstleve's avatar
      For PyPy only, re-enable old behavior (runs the risk of masking bugs) (#4079) · cb35a3c1
      Ralf W. Grosse-Kunstleve authored
      * 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.
      cb35a3c1
  30. 20 Jul, 2022 1 commit
    • Aaron Gokaslan's avatar
      Fix #3812 and fix const of inplace assignments (#4065) · f47f1edf
      Aaron Gokaslan authored
      
      
      * 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: default avatarRalf W. Grosse-Kunstleve <rwgk@google.com>
      f47f1edf
  31. 14 Jul, 2022 1 commit
    • Ralf W. Grosse-Kunstleve's avatar
      Disable implicit conversion of `0` to `pybind11::handle`. (#4008) · 1d811910
      Ralf W. Grosse-Kunstleve authored
      * 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`.
      1d811910
  32. 13 Jul, 2022 1 commit