Skip to content

Commit 645bcd4

Browse files
committed
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 4625adc commit 645bcd4

File tree

2 files changed

+70
-2
lines changed

2 files changed

+70
-2
lines changed

.github/workflows/ci.yml

+67
Original file line numberDiff line numberDiff line change
@@ -1038,3 +1038,70 @@ jobs:
10381038

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

tests/test_exceptions.py

+3-2
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)