Skip to content

Commit fb21f2b

Browse files
committed
[Python] Fix RDF Pythonization tests with builtin_llvm=OFF
On my machine, the RDF pythonization tests don't run when I build ROOT with `builtin_llvm=OFF`. There is a crash unless I do `import numba` in the beginning. I guess it's not a priority to understand the underlying problem because not many people build ROOT like this and the workaround is easy, but at least the tests should be green. We do the same "magically ordered imports" also in other Python tests where ROOT doesn't work together with xgboost because of `std::regexp` symbol clashes, unless you do the import in a certain order: #15183
1 parent 58f0cb1 commit fb21f2b

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

bindings/pyroot/pythonizations/test/rdf_define_pyz.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
import unittest
2-
import ROOT
2+
3+
import numba # noqa: F401
34
import numpy as np
5+
import ROOT
6+
7+
# numba is not used directly, but tests can crash when ROOT is built with
8+
# builtin_llvm=OFF and numba is not imported at the beginning:
9+
410

511
class PyDefine(unittest.TestCase):
612
"""

bindings/pyroot/pythonizations/test/rdf_filter_pyz.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1+
import os
12
import unittest
2-
import ROOT
3+
4+
import numba # noqa: F401
35
import numpy as np
6+
import ROOT
7+
from rdf_filter_pyz_helper import TYPE_TO_SYMBOL, CreateData, filter_dict
8+
9+
# numba is not used directly, but tests can crash when ROOT is built with
10+
# builtin_llvm=OFF and numba is not imported at the beginning:
411

5-
import os
6-
from rdf_filter_pyz_helper import CreateData, TYPE_TO_SYMBOL, filter_dict
712

813

914
class PyFilter(unittest.TestCase):

0 commit comments

Comments
 (0)