Skip to content

Commit 296615a

Browse files
authored
Add macos_brew_install_llvm to ci.yml (#4326)
* Add macos_brew_install_llvm to ci.yml Added block transferred from PR #4324 * `test_cross_module_exception_translator` xfail 'Homebrew Clang' * Add `pip install numpy scipy` (tested already under PR #4324).
1 parent 88b019a commit 296615a

2 files changed

Lines changed: 70 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,3 +1037,70 @@ jobs:
10371037

10381038
- name: Clean directory
10391039
run: git clean -fdx
1040+
1041+
macos_brew_install_llvm:
1042+
name: "macos-latest • brew install llvm"
1043+
runs-on: macos-latest
1044+
1045+
env:
1046+
# https://apple.stackexchange.com/questions/227026/how-to-install-recent-clang-with-homebrew
1047+
LDFLAGS: '-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib'
1048+
1049+
steps:
1050+
- name: Update PATH
1051+
run: echo "/usr/local/opt/llvm/bin" >> $GITHUB_PATH
1052+
1053+
- name: Show env
1054+
run: env
1055+
1056+
- name: Checkout
1057+
uses: actions/checkout@v3
1058+
1059+
- name: Show Clang++ version before brew install llvm
1060+
run: clang++ --version
1061+
1062+
- name: brew install llvm
1063+
run: brew install llvm
1064+
1065+
- name: Show Clang++ version after brew install llvm
1066+
run: clang++ --version
1067+
1068+
- name: Update CMake
1069+
uses: jwlawson/actions-setup-cmake@v1.13
1070+
1071+
- name: Run pip installs
1072+
run: |
1073+
python3 -m pip install --upgrade pip
1074+
python3 -m pip install -r tests/requirements.txt
1075+
python3 -m pip install numpy
1076+
python3 -m pip install scipy
1077+
1078+
- name: Show CMake version
1079+
run: cmake --version
1080+
1081+
- name: CMake Configure
1082+
run: >
1083+
cmake -S . -B .
1084+
-DCMAKE_VERBOSE_MAKEFILE=ON
1085+
-DPYBIND11_WERROR=ON
1086+
-DPYBIND11_SIMPLE_GIL_MANAGEMENT=OFF
1087+
-DDOWNLOAD_CATCH=ON
1088+
-DDOWNLOAD_EIGEN=ON
1089+
-DCMAKE_CXX_COMPILER=clang++
1090+
-DCMAKE_CXX_STANDARD=17
1091+
-DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")
1092+
1093+
- name: Build
1094+
run: cmake --build . -j 2
1095+
1096+
- name: Python tests
1097+
run: cmake --build . --target pytest -j 2
1098+
1099+
- name: C++ tests
1100+
run: cmake --build . --target cpptest -j 2
1101+
1102+
- name: Interface test
1103+
run: cmake --build . --target test_cmake_build -j 2
1104+
1105+
- name: Clean directory
1106+
run: git clean -fdx

tests/test_exceptions.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import env
66
import pybind11_cross_module_tests as cm
7+
import pybind11_tests # noqa: F401
78
from pybind11_tests import exceptions as m
89

910

@@ -72,9 +73,9 @@ def test_cross_module_exceptions(msg):
7273

7374
# TODO: FIXME
7475
@pytest.mark.xfail(
75-
"env.PYPY and env.MACOS",
76+
"env.MACOS and (env.PYPY or pybind11_tests.compiler_info.startswith('Homebrew Clang'))",
7677
raises=RuntimeError,
77-
reason="Expected failure with PyPy and libc++ (Issue #2847 & PR #2999)",
78+
reason="See Issue #2847, PR #2999, PR #4324",
7879
)
7980
def test_cross_module_exception_translator():
8081
with pytest.raises(KeyError):

0 commit comments

Comments
 (0)