1. Aug 03, 2021
  2. Jul 31, 2021
  3. Jul 30, 2021
  4. Jul 29, 2021
  5. Jul 28, 2021
  6. Jul 27, 2021
  7. Jul 22, 2021
  8. Jul 21, 2021
    • jesse-sony's avatar
      Feature/local exception translator (#2650) · d65edfb0
      jesse-sony authored
      * Create a module_internals struct
      
      Since we now have two things that are going to be module local, it felt
      correct to add a struct to manage them.
      
      * Add local exception translators
      
      These are added via the  register_local_exception_translator function
      and are then applied before the global translators
      
      * Add unit tests to show the local exception translator works
      
      * Fix a bug in the unit test with the string value of KeyError
      
      * Fix a formatting issue
      
      * Rename registered_local_types_cpp()
      
      Rename it to get_registered_local_types_cpp() to disambiguate from the
      new member of module_internals
      
      * Add additional comments to new local exception code path
      
      * Add a register_local_exception function
      
      * Add additional unit tests for register_local_exception
      
      * Use get_local_internals like get_internals
      
      * Update documentation for new local exception feature
      
      * Add back a missing space
      
      * Clean-up some issues in the docs
      
      * Remove the code duplication when translating exceptions
      
      Separated out the exception processing into a standalone function in the
      details namespace.
      
      Clean-up some comments as per PR notes as well
      
      * Remove the code duplication in register_exception
      
      * Cleanup some formatting things caught by clang-format
      
      * Remove the templates from exception translators
      
      But I added a using declaration to alias the type.
      
      * Remove the extra local from local_internals variable names
      
      * Add an extra explanatory comment to local_internals
      
      * Fix a typo in the code
      d65edfb0
  9. Jul 20, 2021
  10. Jul 17, 2021
  11. Jul 16, 2021
  12. Jul 15, 2021
  13. Jul 14, 2021
    • Shane Loretz's avatar
      Raise codec errors when casting to std::string (#2903) · 7331d381
      Shane Loretz authored
      
      
      * Raise codec errors when casting to std::string
      
      Allow the codec's exception to be raised instead of RuntimeError when
      casting from py::str to std::string.
      
      PY2 allows ucs surrogates in UTF-8 conversion
      
      Signed-off-by: default avatarShane Loretz <sloretz@openrobotics.org>
      Signed-off-by: default avatarShane Loretz <sloretz@osrfoundation.org>
      
      * Attempt to fix py2 error
      
      * Revert all unicode literals
      
      * Fixed
      
      Co-authored-by: default avatarAaron Gokaslan <skylion.aaron@gmail.com>
      7331d381
    • Ralf W. Grosse-Kunstleve's avatar
      * Removing stray semicolons (discovered by running clang-format v12 followed... · aca6c3ba
      Ralf W. Grosse-Kunstleve authored
      * Removing stray semicolons (discovered by running clang-format v12 followed by tools/check-style.sh). (#3087)
      
      * Manually moving `// NOLINT` comments so that clang-format does not move them to the wrong places.
      
      * Manually reformatting comments related to `static_assert`s so that clang-format does not need two passes.
      
      * Empty lines between #includes, to prevent clang-format from shuffling the order and thereby confusing MSVC 2015.
      
      * git diff -U0 --no-color HEAD^ | python3 $HOME/clone/llvm-project/clang/tools/clang-format/clang-format-diff.py -p1 -style=file -i
      aca6c3ba
    • Antony Lee's avatar
      Add helper to build in-tree extensions. (#2831) · 1be0a0a6
      Antony Lee authored
      
      
      For single-file extensions, a convenient pattern offered by cython
      is to place the source files directly in the python source tree
      (`foo/__init__.py`, `foo/ext.pyx`), deriving the package names from
      their filesystem location.  Adapt this pattern for pybind11, using an
      `intree_extensions` helper, which should be thought of as the moral
      equivalent to `cythonize`.
      
      Differences with cythonize: I chose not to include globbing support
      (`intree_extensions(glob.glob("**/*.cpp"))` seems sufficient), nor to
      provide extension-customization kwargs (directly setting the attributes
      on the resulting Pybind11Extension objects seems sufficient).
      
      We could choose to have `intree_extension` (singular instead) and make
      users write `[*map(intree_extension, glob.glob("**/*.cpp"))]`; no strong
      opinion here.
      
      Co-authored-by: default avatarAaron Gokaslan <skylion.aaron@gmail.com>
      1be0a0a6
    • jbarlow83's avatar
      Improve documentation of discard_as_unraisable() API (#2697) · 2b7985e5
      jbarlow83 authored
      
      
      * Improve documentation of discard_as_unraisable() API
      
      * Update pytypes.h
      
      Remove "the above"
      
      * Update pytypes.h
      
      Fix precommit error
      
      Co-authored-by: default avatarAaron Gokaslan <skylion.aaron@gmail.com>
      2b7985e5
  14. Jul 13, 2021