Merge branch 'master' into smart_holder

This commit is contained in:
Ralf W. Grosse-Kunstleve
2021-10-06 00:47:43 -07:00
9 changed files with 39 additions and 15 deletions

View File

@@ -189,6 +189,14 @@ set(PYBIND11_CROSS_MODULE_GIL_TESTS test_gil_scoped.py)
set(PYBIND11_CLASS_SH_MODULE_LOCAL_TESTS test_class_sh_module_local.py)
set(PYBIND11_EIGEN_REPO
"https://gitlab.com/libeigen/eigen.git"
CACHE STRING "Eigen repository to use for tests")
# This hash is for 3.3.8, using a hash for security reasons
set(PYBIND11_EIGEN_VERSION
"dc252fbf00079ccab57948a164b1421703fe4361"
CACHE STRING "Eigen version to use for tests")
# Check if Eigen is available; if not, remove from PYBIND11_TEST_FILES (but
# keep it in PYBIND11_PYTEST_FILES, so that we get the "eigen is not installed"
# skip message).
@@ -202,13 +210,11 @@ if(PYBIND11_TEST_FILES_EIGEN_I GREATER -1)
message(FATAL_ERROR "CMake 3.11+ required when using DOWNLOAD_EIGEN")
endif()
set(EIGEN3_VERSION_STRING "3.3.8")
include(FetchContent)
FetchContent_Declare(
eigen
GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git
GIT_TAG ${EIGEN3_VERSION_STRING})
GIT_REPOSITORY "${PYBIND11_EIGEN_REPO}"
GIT_TAG "${PYBIND11_EIGEN_VERSION}")
FetchContent_GetProperties(eigen)
if(NOT eigen_POPULATED)

View File

@@ -8,6 +8,7 @@
#include <catch.hpp>
#include <cstdlib>
#include <fstream>
#include <functional>
#include <thread>
@@ -315,7 +316,7 @@ TEST_CASE("sys.argv gets initialized properly") {
{
char *argv[] = {strdup("a.out")};
py::scoped_interpreter argv_scope(true, 1, argv);
free(argv[0]);
std::free(argv[0]);
auto module = py::module::import("test_interpreter");
auto py_widget = module.attr("DerivedWidget")("The question");
const auto &cpp_widget = py_widget.cast<const Widget &>();