- 06 Aug, 2021 2 commits
-
-
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:
Yannick Jadoul <yannick.jadoul@belgacom.net> Co-authored-by:
Aaron Gokaslan <skylion.aaron@gmail.com>
-
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
-
- 30 Jul, 2021 1 commit
-
-
Jerome Robert authored
* mingw64 platform string is like mingw_xxx not "mingw" See https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-python/0099-Change-the-get_platform-method-in-sysconfig-and-dist.patch * Mingw: Do not dllexport exceptions This is a fix for errors like: D:/a/pybind11/pybind11/include/pybind11/detail/common.h:735:23: error: 'dllexport' implies default visibility, but 'class pybind11::builtin_exception' has already been declared with a different visibility 735 | class PYBIND11_EXPORT builtin_exception : public std::runtime_error { | ^~~~~~~~~~~~~~~~~ * GHA: Test Mingw64 build * fix: avoid thin binaries on mingw * fix: drop lto on MinGW * Mingw64: disable PYBIND11_DEPRECATED It trigger many warnings for unknown reasons Co-authored-by:
Henry Schreiner <henryschreineriii@gmail.com>
-
- 29 Jul, 2021 1 commit
-
-
Henry Schreiner authored
-
- 27 Jul, 2021 4 commits
-
-
Ralf W. Grosse-Kunstleve authored
* Fixing `pragma warning pop` for `__INTEL_COMPILER`. * Adding push/pop to 3 tests. Removing #878 from top of pybind11.h (it was/is only needed for 1 test). * Trying again after CI failure, moving the push to the top of 2 tests. * Trying more after CI failure, adding push/pop to pybind11_tests.h, constructor_stats.h. * Moving ICC #2196 suppression to CMakeLists.txt * Fixing condition for `pragma GCC diagnostic push` in pybind11.h * Moving `pragma warning disable 2196` to common.h * Revising #ifdef to be more conservative. * Undoing insertion of notes that will hopefully soon be completely obsolete anyway.
-
Aaron Gokaslan authored
* maint(clang-tidy) Improve code readability * Fix minor typos * Revert optimization that removed test case * Fix comment formatting * Revert another optimization to repro an issue * Remove make_unique since it C++14 and newer only * eformat comments * Fix unsignedness of comparison * Update comment
-
Henry Schreiner authored
-
David Hewitt authored
* Allow python builtins to be used as callbacks * Try to fix pypy segfault * Add expected fail for PyPy * Fix typo * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add more info to xfail * Add env * Try returning false * Try removing the move for pypy * Fix bugs * Try removing move * Just keep ignoring for PyPy * Add back xfail * Fix ctors * Revert change of std::move * Change to skip * Fix bug and edit comments * Remove clang-tidy bugprone fix skip bug Co-authored-by:
Aaron Gokaslan <skylion.aaron@gmail.com> Co-authored-by:
pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
-
- 21 Jul, 2021 1 commit
-
-
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
-
- 14 Jul, 2021 3 commits
-
-
Henry Schreiner authored
* style: disallow PyTest (should be pytest) * style: cleanup spell checking a bit * style: add a few items to the .gitignore
-
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:
Shane Loretz <sloretz@openrobotics.org> Signed-off-by:
Shane Loretz <sloretz@osrfoundation.org> * Attempt to fix py2 error * Revert all unicode literals * Fixed Co-authored-by:
Aaron Gokaslan <skylion.aaron@gmail.com>
-
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
-
- 13 Jul, 2021 4 commits
-
-
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:Aaron Gokaslan <skylion.aaron@gmail.com>
-
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
-
Henry Schreiner authored
-
Henry Schreiner authored
-
- 12 Jul, 2021 3 commits
-
-
Ralf W. Grosse-Kunstleve authored
* Adding test_return_vector_bool_raw_ptr to test_stl.py. * First attempt to make the documentation more accurate, but not trying to be comprehensive, to not bloat the reference table with too many details. * Fixing minor oversights. * Applying reviewer suggestion.
-
Ralf W. Grosse-Kunstleve authored
* Adding iostream.h thread-safety documentation. * Restoring `TestThread` code with added `std::lock_guard<std::mutex>`. * Updating new comments to reflect new information. * Fixing up `git rebase -X theirs` accidents.
-
Ralf W. Grosse-Kunstleve authored
* Copying from prework_no_rst branch (PR #3087): test_numpy_array.cpp, test_stl.cpp * Manual changes reducing NOLINTs. * clang-format-diff.py * Minor adjustment to avoid MSVC warning C4702: unreachable code
-
- 09 Jul, 2021 2 commits
-
-
Ralf W. Grosse-Kunstleve authored
Go all the way fixing clang-tidy issues to avoid the NOLINTNEXTLINE clutter and clang-format issues. This was really meant to be part of PR #3051 but was held back either out of an abundance of caution, or because of confusion caused by stray semicolons. (#3086)
-
Aaron Gokaslan authored
* Enable clang-tidy else-after-return and redundant void checks * Fix remaining else-after * Address reviewer comments * Fix indentation * Rerun clang-tidy post merge
-
- 08 Jul, 2021 1 commit
-
-
Ralf W. Grosse-Kunstleve authored
* Splitting out pybind11/stl/filesystem.h. To solve breakages like: https://github.com/deepmind/open_spiel/runs/2999582108 Mostly following the suggestion here: https://github.com/pybind/pybind11/pull/2730#issuecomment-750507575 Except using pybind11/stl/filesystem.h instead of pybind11/stlfs.h, as decided via chat. stl.h restored to the exact state before merging PR #2730 via: ``` git checkout 733f8de2 stl.h ``` * Properly including new stl subdirectory in pip wheel config. This now passes interactively: ``` pytest tests/extra_python_package/ ``` * iwyu cleanup. iwyuh.py -c -std=c++17 -DPYBIND11_TEST_BOOST -Ipybind11/include -I/usr/include/python3.9 -I/usr/include/eigen3 include/pybind11/stl/filesystem.h * Adding PYBIND11_HAS_FILESYSTEM_IS_OPTIONAL. * Eliminating else after return.
-
- 06 Jul, 2021 1 commit
-
-
Robert Haschke authored
* Unify cast_error message thrown by [simple|unpacking]_collector simple_collector and unpacking_collector throw different error messages when the casting of an argument failed: While the former mentions make_tuple(), the latter emphasises the call argument (and its name/position). * Consolidating "Unable to convert call argument" error reporting code to guarantee uniformity. Co-authored-by:Ralf W. Grosse-Kunstleve <rwgk@google.com>
-
- 04 Jul, 2021 1 commit
-
-
luzpaz authored
Found via `codespell -q 3 -L nd,ot,thist`
-
- 02 Jul, 2021 1 commit
-
-
Antony Lee authored
-
- 30 Jun, 2021 2 commits
-
-
Ralf W. Grosse-Kunstleve authored
-
Ralf W. Grosse-Kunstleve authored
* pickle setstate: setattr __dict__ only if not empty, to not force use of py::dynamic_attr() unnecessarily. * Adding unit test. * Clang 3.6 & 3.7 compatibility. * PyPy compatibility. * Minor iwyu fix, additional comment. * Addressing reviewer requests. * Applying clang-tidy suggested fixes. * Adding check_dynamic_cast_SimpleCppDerived, related to issue #3062.
-
- 26 Jun, 2021 1 commit
-
-
Cris Luengo authored
* Allow casting from None to a custom object, closes #2778 * ci.yml patch from the smart_holder branch for full CI coverage.
-
- 22 Jun, 2021 1 commit
-
-
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
-
- 21 Jun, 2021 1 commit
-
-
Aaron Gokaslan authored
* Enable and apply clang-tidy readability and misc fixes. * Revert deprecated tester * add space to tests/test_constants_and_functions.cpp
-
- 19 Jun, 2021 1 commit
-
-
Aaron Gokaslan authored
* Add more modernize clang-tidy checks * Enable a few more
-
- 08 Jun, 2021 1 commit
-
-
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:Ralf W. Grosse-Kunstleve <rwgk@google.com>
-
- 27 May, 2021 2 commits
-
-
Ralf W. Grosse-Kunstleve authored
Adjusting valgrind suppression for pypocketfft to resolve systematic failures that started to appear on 2020-05-27. (#3022)
-
Yichen authored
* Set visibility of exceptions to default. Co-authored-by:XZiar <czktc2007@gmail.com> * add test * update docs * Skip failed test.
-
- 06 May, 2021 1 commit
-
-
Eric Cousineau authored
test_call_policies: Explicitly check free-functions and static methods
-
- 04 May, 2021 1 commit
-
-
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.
-
- 21 Apr, 2021 1 commit
-
-
Henry Schreiner authored
-
- 14 Apr, 2021 1 commit
-
-
Philipp Bucher authored
* correcting Werror for Intel * adding ward for Intel * adding wards for intel * another ward for Intel * missed one intel ward * exact match for intel compiler * removing inline limits * disable warnings about inline limits * formatter suggestion * more indent * hopefully make formatter happy * addressed review * fix && * Update tests/CMakeLists.txt Co-authored-by:
Henry Schreiner <HenrySchreinerIII@gmail.com> Co-authored-by:
Henry Schreiner <HenrySchreinerIII@gmail.com>
-
- 13 Apr, 2021 1 commit
-
-
Tamaki Nishino authored
* Add a failure test for overloaded functions * Allow function pointer extraction from overloaded functions
-
- 03 Apr, 2021 1 commit
-
-
Ralf W. Grosse-Kunstleve authored
* Adding PyGILState_Check() in object_api<>::operator(). * Enabling PyGILState_Check() for Python >= 3.6 only. Possibly, this explains why PyGILState_Check() cannot safely be used with Python 3.4 and 3.5: https://github.com/python/cpython/pull/10267#issuecomment-434881587 * Adding simple micro benchmark. * Reducing test time to minimum (purely for coverage, not for accurate results). * Fixing silly oversight. * Minor code organization improvement in test. * Adding example runtimes. * Removing capsys (just run with `-k test_callback_num_times -s` and using `.format()`.
-