Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: allow Eigen repo and version to be overridden #3324

Merged
merged 2 commits into from
Oct 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ jobs:
-DPYBIND11_WERROR=ON
-DDOWNLOAD_CATCH=ON
-DDOWNLOAD_EIGEN=ON
-DPYBIND11_EIGEN_REPO=https://gitlab.com/libeigen/eigen-backup
-DCMAKE_CXX_STANDARD=11
${{ matrix.args }}

Expand Down Expand Up @@ -129,6 +130,7 @@ jobs:
-DPYBIND11_WERROR=ON
-DDOWNLOAD_CATCH=ON
-DDOWNLOAD_EIGEN=ON
-DPYBIND11_EIGEN_REPO=https://gitlab.com/libeigen/eigen-backup
-DCMAKE_CXX_STANDARD=17
${{ matrix.args }}
${{ matrix.args2 }}
Expand All @@ -151,6 +153,7 @@ jobs:
-DPYBIND11_WERROR=ON
-DDOWNLOAD_CATCH=ON
-DDOWNLOAD_EIGEN=ON
-DPYBIND11_EIGEN_REPO=https://gitlab.com/libeigen/eigen-backup
-DCMAKE_CXX_STANDARD=17
-DPYBIND11_INTERNALS_VERSION=10000000
"-DPYBIND11_TEST_OVERRIDE=test_call_policies.cpp;test_gil_scoped.cpp;test_thread.cpp"
Expand Down Expand Up @@ -249,6 +252,7 @@ jobs:
-DPYBIND11_WERROR=ON
-DDOWNLOAD_CATCH=ON
-DDOWNLOAD_EIGEN=ON
-DPYBIND11_EIGEN_REPO=https://gitlab.com/libeigen/eigen-backup
-DCMAKE_CXX_STANDARD=17

- name: Build
Expand Down Expand Up @@ -628,6 +632,7 @@ jobs:
-DPYBIND11_WERROR=ON
-DDOWNLOAD_CATCH=ON
-DDOWNLOAD_EIGEN=ON
-DPYBIND11_EIGEN_REPO=https://gitlab.com/libeigen/eigen-backup
-DCMAKE_CXX_STANDARD=11
-DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")

Expand Down Expand Up @@ -774,6 +779,7 @@ jobs:
-DPYBIND11_WERROR=ON
-DDOWNLOAD_CATCH=ON
-DDOWNLOAD_EIGEN=ON
-DPYBIND11_EIGEN_REPO=https://gitlab.com/libeigen/eigen-backup
${{ matrix.args }}
- name: Build C++11
run: cmake --build build -j 2
Expand Down Expand Up @@ -820,6 +826,7 @@ jobs:
-DPYBIND11_WERROR=ON
-DDOWNLOAD_CATCH=ON
-DDOWNLOAD_EIGEN=ON
-DPYBIND11_EIGEN_REPO=https://gitlab.com/libeigen/eigen-backup

- name: Build C++14
run: cmake --build build -j 2
Expand Down Expand Up @@ -869,6 +876,7 @@ jobs:
-DPYBIND11_WERROR=ON
-DDOWNLOAD_CATCH=ON
-DDOWNLOAD_EIGEN=ON
-DPYBIND11_EIGEN_REPO=https://gitlab.com/libeigen/eigen-backup
-DCMAKE_CXX_STANDARD=${{ matrix.std }}
${{ matrix.args }}

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
cmake -S . -B build
-DCMAKE_CXX_CLANG_TIDY="$(which clang-tidy)"
-DDOWNLOAD_EIGEN=ON
-DPYBIND11_EIGEN_REPO=https://gitlab.com/libeigen/eigen-backup
-DDOWNLOAD_CATCH=ON
-DCMAKE_CXX_STANDARD=17

Expand Down
14 changes: 10 additions & 4 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,14 @@ set(PYBIND11_CROSS_MODULE_TESTS test_exceptions.py test_local_bindings.py test_s

set(PYBIND11_CROSS_MODULE_GIL_TESTS test_gil_scoped.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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically, this is also faster on re-configure, too, since it doesn't have to reach out again.

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).
Expand All @@ -184,13 +192,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)
Expand Down