Skip to content

Commit 8cb7e90

Browse files
Install missing dependencies MacOS cppyy jobs
* Install missing dependencies MacOS cppyy jobs * label failing leak check tests on macOS as xfail * update checking external package for testing
1 parent 0cb0ba7 commit 8cb7e90

File tree

6 files changed

+42
-36
lines changed

6 files changed

+42
-36
lines changed

.github/workflows/MacOS.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -436,9 +436,16 @@ jobs:
436436
brew link --overwrite "$pkg"
437437
done
438438
brew upgrade --force
439-
brew install eigen
440-
brew install boost
441439
brew install gnu-sed
440+
# brew install gnu-sed [email protected] boost-python3 eigen psutils
441+
# if [[ "$ARCHITECHURE" == "x86_64" ]]; then
442+
# CPLUS_INCLUDE_PATH="${CPLUS_INCLUDE_PATH}:/usr/local/opt/[email protected]/include"
443+
# CPLUS_INCLUDE_PATH="${CPLUS_INCLUDE_PATH}:/usr/local/opt/Eigen/include"
444+
# else
445+
# CPLUS_INCLUDE_PATH="${CPLUS_INCLUDE_PATH}:/opt/homebrew/opt/[email protected]/include"
446+
# CPLUS_INCLUDE_PATH="${CPLUS_INCLUDE_PATH}:/opt/homebrew/opt/Eigen/include"
447+
# fi
448+
echo "CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH" >> $GITHUB_ENV
442449
pip install distro pytest
443450
444451
@@ -460,9 +467,9 @@ jobs:
460467
if [[ "${cling_on}" == "ON" ]]; then
461468
CLING_DIR="${{ github.workspace }}/cling"
462469
CLING_BUILD_DIR="${{ github.workspace }}/cling/build"
463-
CPLUS_INCLUDE_PATH="${CLING_DIR}/tools/cling/include:${CLING_BUILD_DIR}/include:${LLVM_DIR}/llvm/include:${LLVM_DIR}/clang/include:${LLVM_BUILD_DIR}/include:${LLVM_BUILD_DIR}/tools/clang/include:$PWD/include"
470+
CPLUS_INCLUDE_PATH="${CPLUS_INCLUDE_PATH}:${CLING_DIR}/tools/cling/include:${CLING_BUILD_DIR}/include:${LLVM_DIR}/llvm/include:${LLVM_DIR}/clang/include:${LLVM_BUILD_DIR}/include:${LLVM_BUILD_DIR}/tools/clang/include:$PWD/include"
464471
else
465-
CPLUS_INCLUDE_PATH="${LLVM_DIR}/llvm/include:${LLVM_DIR}/clang/include:${LLVM_BUILD_DIR}/include:${LLVM_BUILD_DIR}/tools/clang/include:$PWD/include"
472+
CPLUS_INCLUDE_PATH="${CPLUS_INCLUDE_PATH}:${LLVM_DIR}/llvm/include:${LLVM_DIR}/clang/include:${LLVM_BUILD_DIR}/include:${LLVM_BUILD_DIR}/tools/clang/include:$PWD/include"
466473
fi
467474
468475
export CB_PYTHON_DIR="${{ github.workspace }}/cppyy-backend/python"
@@ -566,6 +573,7 @@ jobs:
566573
python -m pip install pytest
567574
python -m pip install pytest-xdist
568575
python -m pip install numba
576+
python -m pip install psutil
569577
echo ::endgroup::
570578
echo ::group::Run complete test suite
571579
set -o pipefail

test/test_boost.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
import py, os, sys
2+
import cppyy
23
from pytest import mark, raises, skip
34
from .support import setup_make, IS_CLANG_REPL, IS_MAC_X86, IS_MAC_ARM
45

5-
noboost = False
6-
if not (os.path.exists(os.path.join(os.path.sep, 'usr', 'include', 'boost')) or \
7-
os.path.exists(os.path.join(os.path.sep, 'usr', 'local', 'include', 'boost'))):
8-
noboost = True
6+
noboost = not cppyy.gbl.Cpp.Evaluate("""
7+
#if __has_include("boost/any.hpp")
8+
true
9+
#else
10+
false
11+
#endif
12+
""")
913

10-
11-
@mark.skipif(noboost == True, reason="boost not found")
1214
class TestBOOSTANY:
1315
def setup_class(cls):
1416
import cppyy
1517

1618
cppyy.include('boost/any.hpp')
1719

18-
@mark.skipif((IS_MAC_ARM or IS_MAC_X86), reason="Fails to include boost on OS X")
1920
def test01_any_class(self):
2021
"""Availability of boost::any"""
2122

@@ -67,8 +68,6 @@ def test02_any_usage(self):
6768
extract = boost.any_cast[std.vector[int]](val)
6869
assert len(extract) == 200
6970

70-
71-
@mark.skipif(((noboost == True) or IS_MAC_ARM or IS_MAC_X86), reason="boost not found")
7271
class TestBOOSTOPERATORS:
7372
def setup_class(cls):
7473
import cppyy
@@ -92,8 +91,6 @@ class Derived : boost::ordered_field_operators<Derived>, boost::ordered_field_op
9291

9392
assert cppyy.gbl.boost_test.Derived
9493

95-
96-
@mark.skipif(noboost == True, reason="boost not found")
9794
class TestBOOSTVARIANT:
9895
def setup_class(cls):
9996
import cppyy
@@ -135,7 +132,6 @@ class C { }; } """)
135132
assert type(boost.get['BV::C'](v[2])) == cpp.BV.C
136133

137134

138-
@mark.skipif(((noboost == True) or IS_MAC_ARM or IS_MAC_X86), reason="boost not found")
139135
class TestBOOSTERASURE:
140136
def setup_class(cls):
141137
import cppyy

test/test_cpp11features.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import py, os, sys
22
from pytest import raises, mark
3-
from .support import setup_make, ispypy, IS_CLANG_REPL, IS_LINUX_ARM
3+
from .support import setup_make, ispypy, IS_CLANG_REPL, IS_MAC, IS_LINUX_ARM
44

55

66
currpath = py.path.local(__file__).dirpath()

test/test_eigen.py

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
import py, os, sys
2+
import cppyy
23
from pytest import mark, raises
3-
from .support import setup_make, IS_CLANG_REPL, IS_MAC_X86
4+
from .support import setup_make, IS_CLANG_REPL, IS_MAC_X86, IS_MAC_ARM
45

56
inc_paths = [os.path.join(os.path.sep, 'usr', 'include'),
67
os.path.join(os.path.sep, 'usr', 'local', 'include')]
78

8-
eigen_path = None
9-
for p in inc_paths:
10-
p = os.path.join(p, 'eigen3')
11-
if os.path.exists(p):
12-
eigen_path = p
9+
noeigen = not cppyy.gbl.Cpp.Evaluate("""
10+
#if __has_include("eigen3/Eigen/Dense")
11+
true
12+
#else
13+
false
14+
#endif
15+
""")
1316

14-
15-
@mark.skipif(eigen_path is None, reason="Eigen not found")
17+
@mark.skipif(noeigen == True, reason="Eigen not found")
1618
class TestEIGEN:
1719
def setup_class(cls):
1820
import cppyy, warnings
1921

20-
cppyy.add_include_path(eigen_path)
2122
with warnings.catch_warnings():
22-
warnings.simplefilter('ignore')
23-
cppyy.include('Eigen/Dense')
23+
cppyy.include('eigen3/Eigen/Dense')
2424

2525
@mark.xfail
2626
def test01_simple_matrix_and_vector(self):
@@ -148,17 +148,16 @@ def test04_resizing_through_assignment(self):
148148
assert a.size() == 9
149149

150150

151-
@mark.skipif(eigen_path is None, reason="Eigen not found")
152-
class TestEIGEN_REGRESSIOn:
151+
@mark.skipif(noeigen == True, reason="Eigen not found")
152+
class TestEIGEN_REGRESSION:
153153
def setup_class(cls):
154154
import cppyy, warnings
155155

156-
cppyy.add_include_path(eigen_path)
157156
with warnings.catch_warnings():
158157
warnings.simplefilter('ignore')
159-
cppyy.include('Eigen/Dense')
158+
cppyy.include('eigen3/Eigen/Dense')
160159

161-
@mark.xfail(condition=IS_MAC_X86 and (not IS_CLANG_REPL), reason="Errors out on OS X Cling")
160+
@mark.xfail(condition=((IS_MAC_ARM) or (IS_MAC_X86 and not IS_CLANG_REPL)), reason="Fails on OS X arm and osx 86 for cling")
162161
def test01_use_of_Map(self):
163162
"""Use of Map (used to crash)"""
164163

test/test_leakcheck.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import py, os, sys
22
from pytest import mark, skip
3-
from .support import setup_make, pylong, pyunicode, IS_CLANG_REPL
3+
from .support import setup_make, pylong, pyunicode, IS_CLANG_REPL, IS_MAC
44

55
currpath = py.path.local(__file__).dirpath()
66
test_dct = str(currpath.join("datatypesDict"))
@@ -67,6 +67,7 @@ def check_func(self, scope, func, *args, **kwds):
6767
gc.collect()
6868
assert last == self.process.memory_info().rss
6969

70+
@mark.xfail(condition=IS_MAC, reason="Fails on OS X")
7071
def test01_free_functions(self):
7172
"""Leak test of free functions"""
7273

@@ -92,6 +93,7 @@ def test01_free_functions(self):
9293
self.check_func(ns, 'free_f_ret1')
9394
self.check_func(ns, 'free_f_ret1')
9495

96+
@mark.xfail(condition=IS_MAC, reason="Fails on OS X")
9597
def test02_test_static_methods(self):
9698
"""Leak test of static methods"""
9799

@@ -118,6 +120,7 @@ class MyClass02 {
118120
self.check_func(m, 'static_method_ol', 42., tmpl_args='float')
119121
self.check_func(m, 'static_method_ret')
120122

123+
@mark.xfail(condition=IS_MAC, reason="Fails on OS X")
121124
def test03_test_methods(self):
122125
"""Leak test of methods"""
123126

test/test_lowlevel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import py, os, sys
22
from pytest import raises, skip, mark
3-
from .support import setup_make, pylong, pyunicode, IS_WINDOWS, ispypy, IS_CLANG_REPL, IS_MAC
3+
from .support import setup_make, pylong, pyunicode, IS_WINDOWS, ispypy, IS_CLANG_REPL, IS_MAC, IS_MAC_X86
44

55
currpath = py.path.local(__file__).dirpath()
66
test_dct = str(currpath.join("datatypesDict"))
@@ -484,7 +484,7 @@ def test14_templated_arrays(self):
484484
assert cppyy.gbl.std.vector[cppyy.gbl.std.vector[int]].value_type == 'std::vector<int>'
485485
assert cppyy.gbl.std.vector['int[1]'].value_type == 'int[1]'
486486

487-
@mark.xfail
487+
@mark.xfail(run=not (IS_MAC_X86 and not IS_CLANG_REPL), reason="Crashes on OSX-X86 Cling")
488488
def test15_templated_arrays_gmpxx(self):
489489
"""Use of gmpxx array types in templates"""
490490

0 commit comments

Comments
 (0)