1. Jan 25, 2021
    • crimsoncor's avatar
      Force the builtin module key to be the correct type. (#2814) · 9ea39dc3
      crimsoncor authored
      
      
      * Force the builtin module key to be the correct type.
      
      Previously it was always going to be a std::string which converted into
      unicode. Python 2 appears to want module keys to be normal str types, so
      this was breaking code that expected plain string types in the
      builtins.keys() data structure
      
      * Add a simple unit test to ensure all built-in keys are str
      
      * Update the unit test so it will also run on pypy
      
      * Run pre-commit.
      
      Co-authored-by: default avatarJesse Clemens <jesse.clemens@sony.com>
      9ea39dc3
  2. Jan 22, 2021
  3. Jan 20, 2021
  4. Jan 18, 2021
    • Michael Kuron's avatar
      fix: Intel ICC C++17 compatibility (#2729) · 48534089
      Michael Kuron authored
      * CI: Intel icc/icpc via oneAPI
      
      Add testing for Intel icc/icpc via the oneAPI images.
      Intel oneAPI is in a late beta stage, currently shipping
      oneAPI beta09 with ICC 20.2.
      
      CI: Skip Interpreter Tests for Intel
      
      Cannot find how to add this, neiter the package `libc6-dev` nor
      `intel-oneapi-mkl-devel` help when installed to solve this:
      ```
      -- Looking for C++ include pthread.h
      -- Looking for C++ include pthread.h - not found
      CMake Error at /__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
        Could NOT find Threads (missing: Threads_FOUND)
      Call Stack (most recent call first):
        /__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
        /__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindThreads.cmake:234 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
        tests/test_embed/CMakeLists.txt:...
      48534089
  5. Jan 17, 2021
    • Yannick Jadoul's avatar
      fix: only allow integer type_caster to call __int__ method when conversion is... · 8449a808
      Yannick Jadoul authored
      fix: only allow integer type_caster to call __int__ method when conversion is allowed; always call __index__ (#2698)
      
      * Only allow integer type_caster to call __int__ or __index__ method when conversion is allowed
      
      * Remove tests for __index__ as this seems to only be used to convert to int in 3.8+
      
      * Take both `int` and `long` types into account for Python 2
      
      * Add test_numpy_int_convert to assert tests currently fail, even though np.intc has an __index__ method
      
      * Also consider __index__ as noconvert to a C++ integer
      
      * New-style classes for Python 2.7; sigh
      
      * Add some tests on types with custom __index__ method
      
      * Ignore some tests in Python <3.8
      
      * Update comment about conversion from np.float32 to C++ int
      
      * Workaround difference between CPython and PyPy's different PyIndex_Check (unnoticed because we currently don't have PyPy >= 3.8)
      
      * Avoid ICC segfault with py::arg()
      8449a808
    • Henry Schreiner's avatar
      docs: update build description slightly (#2794) · 0df11d85
      Henry Schreiner authored
      * docs: update build description slightly
      
      * docs: missing ticks
      0df11d85
  6. Jan 16, 2021
    • Axel Huebl's avatar
      ci: Intel icc/icpc via oneAPI (#2573) · 0b3df7f9
      Axel Huebl authored
      
      
      * CI: Intel icc/icpc via oneAPI
      
      Add testing for Intel icc/icpc via the oneAPI images.
      Intel oneAPI is in a late beta stage, currently shipping
      oneAPI beta09 with ICC 20.2.
      
      * CI: Skip Interpreter Tests for Intel
      
      Cannot find how to add this, neiter the package `libc6-dev` nor
      `intel-oneapi-mkl-devel` help when installed to solve this:
      ```
      -- Looking for C++ include pthread.h
      -- Looking for C++ include pthread.h - not found
      CMake Error at /__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
        Could NOT find Threads (missing: Threads_FOUND)
      Call Stack (most recent call first):
        /__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
        /__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindThreads.cmake:234 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
        tests/test_embed/CMakeLists.txt:17 (find_package)
      ```
      
      * CI: libc6-dev from GCC for ICC
      
      * CI: Run bare metal for oneAPI
      
      * CI: Ubuntu 18.04 for oneAPI
      
      * CI: Intel +Catch -Eigen
      
      * CI: CMake from Apt (ICC tests)
      
      * CI: Replace Intel Py with GCC Py
      
      * CI: Intel w/o GCC's Eigen
      
      * CI: ICC with verbose make
      
      * [Debug] Find core dump
      
      * tests: use arg{} instead of arg() for Intel
      
      * tests: adding a few more missing {}
      
      * fix: sync with @tobiasleibner's branch
      
      * fix: try ubuntu 20-04
      
      * fix: drop exit 1
      
      * style: clang tidy fix
      
      * style: fix missing NOLINT
      
      * ICC: Update Compiler Name
      
      Changed upstream with the last oneAPI release.
      
      * ICC CI: Downgrade pytest
      
      pytest 6 does not capture the `discard_as_unraisable` stderr and
      just writes a warning with its content instead.
      
      * Use new test pinning requirements.txt
      
      * tests: add notes about intel, cleanup
      
      Co-authored-by: default avatarHenry Schreiner <henryschreineriii@gmail.com>
      0b3df7f9
    • Yannick Jadoul's avatar
      Add a Valgrind build on debug Python 3.9 (#2746) · 0f8d5f2e
      Yannick Jadoul authored
      
      
      * Adding a valgrind build on debug Python 3.9
      
      Co-authored-by: default avatarBoris Staletic <boris.staletic@gmail.com>
      
      * Add Valgrind suppression files
      
      - Introduce suppression file, populate it with a first suppression taken from CPython, and fix one leak in the tests
      - Suppress leak in NumPy
      - More clean tests!
      - Tests with names a-e passing (except for test_buffer)
      - Suppress multiprocessing errors
      - Merge multiprocessing suppressions into other suppression files
      - Numpy seems to be spelled with a big P
      - Append single entry from valgrind-misc.supp to valgrind-python.supp, and make clear valgrind-python.supp is only CPython
      
      Co-authored-by: default avatarBoris Staletic <boris.staletic@gmail.com>
      
      * Enable test_virtual_functions with a workaround
      
      * Add a memcheck cmake target
      
      - Add a memcheck cmake target
      - Reformat cmake
      - Appease the formatting overlords - they are angry
      - Format CMake valgrind target decently
      
      * Update CI config to new action versions
      
      * fix: separate memcheck from pytest
      
      * ci: cleanup
      
      * Merge Valgrind and other deadsnakes builds
      
      Co-authored-by: default avatarBoris Staletic <boris.staletic@gmail.com>
      Co-authored-by: default avatarHenry Schreiner <henryschreineriii@gmail.com>
      0f8d5f2e
  7. Jan 15, 2021
    • heyer2's avatar
      fix: STATIC and SHARED flags not being detected (#2796) · 76a16007
      heyer2 authored
      
      
      * Fix STATIC and SHARED flags not being detected
      
      * fix: use classic naming for all lib types
      
      Co-authored-by: default avatarHenry Schreiner <henryschreineriii@gmail.com>
      76a16007
    • Yannick Jadoul's avatar
      Plug leaking function_records in cpp_function initialization in case of... · 08551463
      Yannick Jadoul authored
      Plug leaking function_records in cpp_function initialization in case of exceptions (found by Valgrind in #2746) (#2756)
      
      * Plug leaking function_record objects when exceptions are thrown
      
      * Plug leak of strdup'ed strings in function_record
      
      * Some extra comments about the function_record ownership dance
      
      * Clean up the function_record better, in case of exceptions
      
      * Demonstrate some extra function_record leaks
      
      * Change  DeleteStrings template argument to free_strings runtime argument in destruct(function_record *)
      
      * Zero-state unique_function_record deleter object
      
      * Clarify rvalue reference to unique_ptr parameter in initialize_generic
      
      * Use push_back with const char * instead of emplace_back
      08551463
  8. Jan 14, 2021
  9. Jan 02, 2021
    • Yannick Jadoul's avatar
      Ignore deprecation warnings about old-style __init__/__setstate__ constructors... · 98f1bbb8
      Yannick Jadoul authored
      Ignore deprecation warnings about old-style __init__/__setstate__ constructors in the tests (originally done in #2746) (#2759)
      
      * Ignore old-style __init__ warnings
      
      * Simplify ignoreOldStyleInitWarnings with py::exec
      
      * Only wrap single class_::defs to ignore DeprecationWarnings about old-style __init__
      98f1bbb8
    • Yannick Jadoul's avatar
      Fix various minor memory leaks in the tests (found by Valgrind in #2746) (#2758) · e57dd471
      Yannick Jadoul authored
      * Fix leak in the test_copy_move::test_move_fallback
      
      * Fix leaking PyMethodDef in test_class::test_implicit_conversion_life_support
      
      * Plumb leak in test_buffer, occuring when a mutable buffer is requested for a read-only object, and enable test_buffer.py
      
      * Fix weird return_value_policy::reference in test_stl_binders, and enable those tests
      
      * Cleanup nodelete holder objects in test_smart_ptr, and enable those tests
      e57dd471
  10. Jan 01, 2021
  11. Dec 29, 2020
  12. Dec 28, 2020
  13. Dec 24, 2020
    • Yannick Jadoul's avatar
      tests: update pytest 6.2.1 and fix test_python_alreadyset_in_destructor (#2741) · 830f8eda
      Yannick Jadoul authored
      * Update pytest to 6.2.1 in tests/requirements.txt
      
      * Pin pytest to last supported version for 3.5
      
      * Suppress PytestUnraisableExceptionWarning and use sys.__unraisablehook__ instead of sys.unraisablehook
      
      * Fix filterwarnings mark on old pytest and old Python versions
      
      * Cleanup ignore_pytest_unraisable_warning decorator
      830f8eda
    • Steve Siano's avatar
      docs: add a note about compiling the example (#2737) · 6f66e760
      Steve Siano authored
      * docs: mention PYTHONPATH in installing.rst
      
      When pybind11 is included as a submodule, the user needs to update their
      Python module search path.  Otherwise, the first c++ compilation command
      in docs/basics.rst will fail.
      
      * docs: add a note about compiling the example
      
      This note shows how to modify the compilation command for the example
      when the pybind11 source has been included as a Git submodule.
      
      * docs: add a note about compiling the example
      
      Added an internal link to the docs
      
      * docs: updated a note about compiling the example
      
      Also updated the command substitution syntax for consistency
      6f66e760
    • Eric Cousineau's avatar
  14. Dec 22, 2020
  15. Dec 20, 2020
  16. Dec 19, 2020