1. 31 Aug, 2021 3 commits
    • Ralf W. Grosse-Kunstleve's avatar
      Minor follow-on to PR #1334 (Fix enum value's __int__ returning non-int when... · 49173e47
      Ralf W. Grosse-Kunstleve authored
      Minor follow-on to PR #1334 (Fix enum value's __int__ returning non-int when underlying type is bool or of char type) (#3232)
      
      * Minor tweaks.
      
      * Restoring tests/pybind11_tests.h version from master, removing just the comment and empty line that was added in PR #3087; those were made obsolete by the pragma cleanup that concluded with PR #3186.
      
      * More-to-the-point test for Python 3.
      49173e47
    • Ralf W. Grosse-Kunstleve's avatar
      Minor tweaks. (#3230) · a46f6237
      Ralf W. Grosse-Kunstleve authored
      * Minor tweaks.
      
      * Restoring tests/pybind11_tests.h version from master, removing just the comment and empty line that was added in PR #3087; those were made obsolete by the pragma cleanup that concluded with PR #3186.
      
      * [ci skip] Restoring tests/test_enum.py from master.
      a46f6237
    • Tailing Yuan's avatar
      fix: memory leak in cpp_function (#3228) (#3229) · d6474ed7
      Tailing Yuan authored
      
      
      * fix: memory leak in cpp_function (#3228)
      
      * add a test case to check objects are deconstructed in cpp_function
      
      * update the test case about cpp_function
      
      * fix the test case about cpp_function: remove "noexcept"
      
      * Actually calling func. CHECK(stat.alive() == 2); Manually verified that the new tests fails without the change in pybind11.h
      
      * Moving new test to test_callbacks.cpp,py, with small enhancements.
      
      * Removing new test from test_interpreter.cpp (after it was moved to test_callbacks.cpp,py). This restores test_interpreter.cpp to the current state on master.
      
      * Using py::detail::silence_unused_warnings(py_func); to make the intent clear.
      Co-authored-by: default avatarRalf W. Grosse-Kunstleve <rwgk@google.com>
      d6474ed7
  2. 28 Aug, 2021 1 commit
    • Ralf W. Grosse-Kunstleve's avatar
      Adding `ssize_t_cast` to support passing `size_t` or `ssize_t` values where... · 777352fc
      Ralf W. Grosse-Kunstleve authored
      Adding `ssize_t_cast` to support passing `size_t` or `ssize_t` values where `ssize_t` is needed. (#3219)
      
      * Trivial change to avoid (ssize_t) cast.
      
      * Demo for safe_ssize_t idea.
      
      * Removing safe_ssize_t.cpp (proof-of-concept code) to not upset the GHA Format workflow.
      
      * Completing changes in pytypes.h
      
      * New ssize_t_cast (better replacement for safe_ssize_t).
      
      * clang-format-diff (no manual changes).
      
      * bytes_ssize_t -Wnarrowing reproducer (see PR #2692).
      
      * Backing out tuple(), list() ssize_t support, for compatibility with older compilers (to resolve link failures).
      
      * Bug fix: missing `py::` for `py::ssize_t`
      
      * Restoring tuple(), list() ssize_t support, but passing `size` by value, for compatibility with older compilers (to resolve link failures).
      
      * Full test coverage of all functions with modified signatures.
      777352fc
  3. 26 Aug, 2021 6 commits
  4. 24 Aug, 2021 1 commit
  5. 19 Aug, 2021 2 commits
    • Liam Keegan's avatar
      ci: extend msys2 mingw CI (#3207) · 4f29b8a4
      Liam Keegan authored
      * extend msys2 CI
      
      - add 32-bit job
      - add c++11/17 c++/interface tests copied from standard ci
      - add numpy/scipy
      
      * account for padding of PartialStruct in numpy dtypes test with mingw32
      
      * [pre-commit.ci] auto fixes from pre-commit.com hooks
      
      for more information, see https://pre-commit.ci
      
      
      
      * msys2 ci: add c++14 tests
      Co-authored-by: default avatarpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
      4f29b8a4
    • Ralf W. Grosse-Kunstleve's avatar
      Cleanup of file-scoped and globally-scoped warning suppression pragmas across... · 998d45e4
      Ralf W. Grosse-Kunstleve authored
      Cleanup of file-scoped and globally-scoped warning suppression pragmas across pybind11 header files. (#3201)
      
      * Removing all MSVC C4127 warning suppression pragmas.
      
      * Removing MSVC /WX (WERROR). To get a full list of all warnings.
      
      * Inserting PYBIND11_SILENCE_MSVC_C4127. Changing one runtime if to #if.
      
      * Changing PYBIND11_SILENCE_MSVC_C4127 macro to use absolute namespace (for use outside pybind11 include directory).
      
      * Restoring MSVC /WX (WERROR).
      
      * Removing globally-scoped suppression for clang -Wunsequenced. Based on an experiment under PR #3202 it is obsolete and can simply be removed.
      998d45e4
  6. 13 Aug, 2021 1 commit
    • Aaron Gokaslan's avatar
      maint(precommit): Apply isort (#3195) · 9df2f1ff
      Aaron Gokaslan authored
      * Apply isort
      
      * Tweak isort config
      
      * Add env.py as a known_first_party
      
      * Add one missing known first party
      
      * Make config compat with older isort versions
      
      * Add another comment
      
      * Revert pyproject setting
      9df2f1ff
  7. 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
  8. 30 Jul, 2021 1 commit
  9. 29 Jul, 2021 1 commit
  10. 27 Jul, 2021 4 commits
  11. 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
  12. 14 Jul, 2021 3 commits
  13. 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
  14. 12 Jul, 2021 3 commits
  15. 09 Jul, 2021 2 commits
  16. 08 Jul, 2021 1 commit
  17. 06 Jul, 2021 1 commit
  18. 04 Jul, 2021 1 commit
  19. 02 Jul, 2021 1 commit
  20. 30 Jun, 2021 1 commit