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

Install missing dependencies MacOS cppyy jobs #134

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
16 changes: 12 additions & 4 deletions .github/workflows/MacOS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -439,9 +439,16 @@ jobs:
brew link --overwrite "$pkg"
done
brew upgrade --force
brew install eigen
brew install boost
brew install gnu-sed
# 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
pip install distro pytest


Expand All @@ -463,9 +470,9 @@ jobs:
if [[ "${cling_on}" == "ON" ]]; then
CLING_DIR="${{ github.workspace }}/cling"
CLING_BUILD_DIR="${{ github.workspace }}/cling/build"
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="${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="${LLVM_DIR}/llvm/include:${LLVM_DIR}/clang/include:${LLVM_BUILD_DIR}/include:${LLVM_BUILD_DIR}/tools/clang/include:$PWD/include"
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"
fi

export CB_PYTHON_DIR="${{ github.workspace }}/cppyy-backend/python"
Expand Down Expand Up @@ -569,6 +576,7 @@ 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: 8 additions & 12 deletions test/test_boost.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
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 = 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
noboost = not cppyy.gbl.Cpp.Evaluate("""
#if __has_include("boost/any.hpp")
true
#else
false
#endif
""")


@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 @@ -67,8 +68,6 @@ 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 @@ -92,8 +91,6 @@ 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 @@ -135,7 +132,6 @@ 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_LINUX_ARM
from .support import setup_make, ispypy, IS_CLANG_REPL, IS_MAC, IS_LINUX_ARM


currpath = py.path.local(__file__).dirpath()
Expand Down
31 changes: 15 additions & 16 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
from .support import setup_make, IS_CLANG_REPL, IS_MAC_X86, IS_MAC_ARM

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

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


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

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

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


@mark.skipif(eigen_path is None, reason="Eigen not found")
class TestEIGEN_REGRESSIOn:
@mark.skipif(noeigen == True, 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('Eigen/Dense')
cppyy.include('eigen3/Eigen/Dense')

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

Expand Down
5 changes: 4 additions & 1 deletion 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
from .support import setup_make, pylong, pyunicode, IS_CLANG_REPL, IS_MAC

currpath = py.path.local(__file__).dirpath()
test_dct = str(currpath.join("datatypesDict"))
Expand Down Expand Up @@ -67,6 +67,7 @@ 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 @@ -92,6 +93,7 @@ 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 @@ -118,6 +120,7 @@ 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
from .support import setup_make, pylong, pyunicode, IS_WINDOWS, ispypy, IS_CLANG_REPL, IS_MAC, IS_MAC_X86

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

Expand Down
Loading