Skip to content

Commit

Permalink
Revert "Install missing dependencies MacOS cppyy jobs (#125)"
Browse files Browse the repository at this point in the history
This reverts commit bf43358.
  • Loading branch information
Vipul-Cariappa authored Feb 6, 2025
1 parent bf43358 commit d19b78e
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 42 deletions.
17 changes: 5 additions & 12 deletions .github/workflows/MacOS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -439,15 +439,9 @@ jobs:
brew link --overwrite "$pkg"
done
brew upgrade --force
brew install gnu-sed [email protected] boost-python3 eigen psutils
if [[ "$ARCHITECHURE" == "x86_64" ]]; then
CPLUS_INCLUDE_PATH="${CPLUS_INCLUDE_PATH}:/usr/local/opt/[email protected]/include"
CPLUS_INCLUDE_PATH="${CPLUS_INCLUDE_PATH}:/usr/local/opt/Eigen/include"
else
CPLUS_INCLUDE_PATH="${CPLUS_INCLUDE_PATH}:/opt/homebrew/opt/[email protected]/include"
CPLUS_INCLUDE_PATH="${CPLUS_INCLUDE_PATH}:/opt/homebrew/opt/Eigen/include"
fi
echo "CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH" >> $GITHUB_ENV
brew install eigen
brew install boost
brew install gnu-sed
pip install distro pytest
Expand All @@ -469,9 +463,9 @@ jobs:
if [[ "${cling_on}" == "ON" ]]; then
CLING_DIR="${{ github.workspace }}/cling"
CLING_BUILD_DIR="${{ github.workspace }}/cling/build"
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"
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"
else
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"
CPLUS_INCLUDE_PATH="${LLVM_DIR}/llvm/include:${LLVM_DIR}/clang/include:${LLVM_BUILD_DIR}/include:${LLVM_BUILD_DIR}/tools/clang/include:$PWD/include"
fi
export CB_PYTHON_DIR="${{ github.workspace }}/cppyy-backend/python"
Expand Down Expand Up @@ -575,7 +569,6 @@ jobs:
python -m pip install pytest
python -m pip install pytest-xdist
python -m pip install numba
python -m pip install psutil
echo ::endgroup::
echo ::group::Run complete test suite
set -o pipefail
Expand Down
20 changes: 12 additions & 8 deletions test/test_boost.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
import py, os, sys
import cppyy
from pytest import mark, raises, skip
from .support import setup_make, IS_CLANG_REPL, IS_MAC_X86, IS_MAC_ARM

noboost = not cppyy.gbl.Cpp.Evaluate("""
#if __has_include("boost/any.hpp")
true
#else
false
#endif
""")
noboost = False
if not (os.path.exists(os.path.join(os.path.sep, 'usr', 'include', 'boost')) or \
os.path.exists(os.path.join(os.path.sep, 'usr', 'local', 'include', 'boost'))):
noboost = True


@mark.skipif(noboost == True, reason="boost not found")
class TestBOOSTANY:
def setup_class(cls):
import cppyy

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

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

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


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

assert cppyy.gbl.boost_test.Derived


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


@mark.skipif(((noboost == True) or IS_MAC_ARM or IS_MAC_X86), reason="boost not found")
class TestBOOSTERASURE:
def setup_class(cls):
import cppyy
Expand Down
2 changes: 1 addition & 1 deletion test/test_cpp11features.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import py, os, sys
from pytest import raises, mark
from .support import setup_make, ispypy, IS_CLANG_REPL, IS_MAC, IS_LINUX_ARM
from .support import setup_make, ispypy, IS_CLANG_REPL, IS_LINUX_ARM


currpath = py.path.local(__file__).dirpath()
Expand Down
31 changes: 16 additions & 15 deletions test/test_eigen.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
import py, os, sys
import cppyy
from pytest import mark, raises
from .support import setup_make, IS_CLANG_REPL, IS_MAC_X86, IS_MAC_ARM
from .support import setup_make, IS_CLANG_REPL, IS_MAC_X86

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

noeigen = not cppyy.gbl.Cpp.Evaluate("""
#if __has_include("eigen3/Eigen/Dense")
true
#else
false
#endif
""")
eigen_path = None
for p in inc_paths:
p = os.path.join(p, 'eigen3')
if os.path.exists(p):
eigen_path = p

@mark.skipif(noeigen == True, reason="Eigen not found")

@mark.skipif(eigen_path is None, reason="Eigen not found")
class TestEIGEN:
def setup_class(cls):
import cppyy, warnings

cppyy.add_include_path(eigen_path)
with warnings.catch_warnings():
cppyy.include('eigen3/Eigen/Dense')
warnings.simplefilter('ignore')
cppyy.include('Eigen/Dense')

@mark.xfail
def test01_simple_matrix_and_vector(self):
Expand Down Expand Up @@ -148,16 +148,17 @@ def test04_resizing_through_assignment(self):
assert a.size() == 9


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

cppyy.add_include_path(eigen_path)
with warnings.catch_warnings():
warnings.simplefilter('ignore')
cppyy.include('eigen3/Eigen/Dense')
cppyy.include('Eigen/Dense')

@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")
@mark.xfail(condition=IS_MAC_X86 and (not IS_CLANG_REPL), reason="Errors out on OS X Cling")
def test01_use_of_Map(self):
"""Use of Map (used to crash)"""

Expand Down
5 changes: 1 addition & 4 deletions test/test_leakcheck.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import py, os, sys
from pytest import mark, skip
from .support import setup_make, pylong, pyunicode, IS_CLANG_REPL, IS_MAC
from .support import setup_make, pylong, pyunicode, IS_CLANG_REPL

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

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

Expand All @@ -93,7 +92,6 @@ def test01_free_functions(self):
self.check_func(ns, 'free_f_ret1')
self.check_func(ns, 'free_f_ret1')

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

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

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

Expand Down
4 changes: 2 additions & 2 deletions test/test_lowlevel.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import py, os, sys
from pytest import raises, skip, mark
from .support import setup_make, pylong, pyunicode, IS_WINDOWS, ispypy, IS_CLANG_REPL, IS_MAC, IS_MAC_X86
from .support import setup_make, pylong, pyunicode, IS_WINDOWS, ispypy, IS_CLANG_REPL, IS_MAC

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

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

Expand Down

0 comments on commit d19b78e

Please sign in to comment.