1. 06 Aug, 2021 2 commits
    • Eric Cousineau's avatar
      test_eval: Show example of working closure (#2743) · 6ac8efe5
      Eric Cousineau authored
      
      
      * test_eval: Show example of working closure
      
      * Extend test_eval_closure with weirder examples of closures for py::eval
      Co-authored-by: default avatarYannick Jadoul <yannick.jadoul@belgacom.net>
      Co-authored-by: default avatarAaron Gokaslan <skylion.aaron@gmail.com>
      6ac8efe5
    • Aaron Gokaslan's avatar
      maint(clang-tidy): Bugprone enable checks (#3166) · 3893f37b
      Aaron Gokaslan authored
      * Enable bugprone checks
      
      * Reset delta and massage config
      
      * Start to apply bugprone fixes
      
      * try to fix minor bug
      
      * Fix later
      
      * Fix perfect forwarding bugprone
      
      * Remove nolint
      
      * undo constructor delete
      
      * Fix bugprone-perfect-forwarding again
      
      * Remove TODO
      
      * Add another nolint for bugprone-exception-escape in scoped interpreter
      
      * Fix remaining bugprone errors
      
      * Properly apply bugprone-macro-parantheses
      
      * Redo formatting and remove bugprone nolint
      
      * Add coment and revert more whitespace changes
      
      * Fix typo
      
      * Fix parsing bug
      
      * Add back comma
      
      * Fix clang-tidy issue
      
      * Apply remaining clang-tidy fixes
      3893f37b
  2. 30 Jul, 2021 1 commit
  3. 29 Jul, 2021 1 commit
  4. 27 Jul, 2021 4 commits
  5. 21 Jul, 2021 1 commit
    • 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
  6. 14 Jul, 2021 3 commits
  7. 13 Jul, 2021 4 commits
    • 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
    • Aaron Gokaslan's avatar
      fix(clang-tidy): Add cppcoreguidelines-init-vars,slicing, and... · 25e470c5
      Aaron Gokaslan authored
      fix(clang-tidy): Add cppcoreguidelines-init-vars,slicing, and throw-by-value-catch-by-reference checks (#3094)
      
      * clang-tidy: guard against more UB behavior
      
      * Remove slicing check for now
      25e470c5
    • Henry Schreiner's avatar
      style: add pyupgrade check, 2.7+ · 0e2e0035
      Henry Schreiner authored
      0e2e0035
    • Henry Schreiner's avatar
      chore: update pre-commit hooks · 84fdadfb
      Henry Schreiner authored
      84fdadfb
  8. 12 Jul, 2021 3 commits
  9. 09 Jul, 2021 2 commits
  10. 08 Jul, 2021 1 commit
  11. 06 Jul, 2021 1 commit
  12. 04 Jul, 2021 1 commit
  13. 02 Jul, 2021 1 commit
  14. 30 Jun, 2021 2 commits
  15. 26 Jun, 2021 1 commit
  16. 22 Jun, 2021 1 commit
    • Aaron Gokaslan's avatar
      fix(clang-tidy): performance fixes applied in tests and CI (#3051) · dac74ebd
      Aaron Gokaslan authored
      * Initial fixes
      
      * Whoops
      
      * Finish clang-tidy manual fixes
      
      * Add two missing fixes
      
      * Revert
      
      * Update clang-tidy
      
      * Try to fix unreachable code error
      
      * Move nolint comment
      
      * Apply missing fix
      
      * Don't override clang-tidy config
      
      * Does this fix clang-tidy?
      
      * Make all clang-tidy errors visible
      
      * Add comments about NOLINTs and remove a few
      
      * Fix typo
      dac74ebd
  17. 21 Jun, 2021 1 commit
  18. 19 Jun, 2021 1 commit
  19. 08 Jun, 2021 1 commit
    • Jack S. Hale's avatar
      Add const T to docstring generation. (#3020) · 4c7697db
      Jack S. Hale authored
      
      
      * Add const T to docstring generation.
      
      * Change order.
      
      * See if existing test triggers for a const type.
      
      * Add tests.
      
      * Fix test.
      
      * Remove experiment.
      
      * Reformat.
      
      * More tests, checks run.
      
      * Adding `test_fmt_desc_` prefix to new test functions.
      
      * Using pytest.mark.parametrize to 1. condense test; 2. exercise all functions even if one fails; 3. be less platform-specific (e.g. C++ float is not necessarily float32).
      Co-authored-by: default avatarRalf W. Grosse-Kunstleve <rwgk@google.com>
      4c7697db
  20. 27 May, 2021 2 commits
  21. 06 May, 2021 1 commit
  22. 04 May, 2021 1 commit
    • Pieter P's avatar
      Fix Unicode support for ostream redirects (#2982) · 0c93a0f3
      Pieter P authored
      * Crash when printing Unicode to redirected cout
      Add failing tests
      
      * Fix Unicode crashes redirected cout
      
      * pythonbuf::utf8_remainder check end iterator
      
      * Remove trailing whitespace and formatting iostream
      
      * Avoid buffer overflow if ostream redirect races
      This doesn't solve the actual race, but at least it now has a much lower
      probability of reading past the end of the buffer even when data races
      do occur.
      0c93a0f3
  23. 21 Apr, 2021 1 commit
  24. 14 Apr, 2021 1 commit
  25. 13 Apr, 2021 1 commit
  26. 03 Apr, 2021 1 commit