Skip to content

Commit 042f698

Browse files
committed
[CMake] Also check for sklearn if the test requires it via xgboost
Fixes the failures in the nighlies on Fedora 43, which uses Python 3.14 where xgboost is available but sklearn is not.
1 parent cd7fd86 commit 042f698

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

tmva/tmva/test/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ if(dataframe)
3636
endif()
3737

3838
if(dataframe)
39+
# Test uses the xgboost sklearn plugin, so we need to check for sklearn too.
3940
ROOT_FIND_PYTHON_MODULE(xgboost QUIET)
40-
if (ROOT_XGBOOST_FOUND)
41+
ROOT_FIND_PYTHON_MODULE(sklearn QUIET)
42+
if (ROOT_XGBOOST_FOUND AND ROOT_SKLEARN_FOUND)
4143
ROOT_ADD_PYUNITTEST(rbdt_xgboost rbdt_xgboost.py)
4244
endif()
4345
endif()

tutorials/CMakeLists.txt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -812,12 +812,6 @@ if(ROOT_pyroot_FOUND)
812812
# Disable tutorial showing connection to the HTCondor service at CERN
813813
list(APPEND pyveto analysis/dataframe/distrdf004_dask_lxbatch.py)
814814

815-
ROOT_FIND_PYTHON_MODULE(xgboost QUIET)
816-
if(NOT ROOT_XGBOOST_FOUND OR NOT dataframe)
817-
file(GLOB tmva_veto_py RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} machine_learning/tmva10*.py roofit/roofit/rf618_mixture_models.py)
818-
list(APPEND pyveto ${tmva_veto_py})
819-
endif()
820-
821815
if(NOT tmva-pymva)
822816
file(GLOB tmva_veto_py RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} machine_learning/keras/*.py)
823817
list(APPEND pyveto ${tmva_veto_py})
@@ -923,10 +917,15 @@ if(ROOT_pyroot_FOUND)
923917
machine_learning/pytorch/*.py
924918
machine_learning/RBatchGenerator_PyTorch.py
925919
)
926-
file(GLOB requires_xgboost RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} machine_learning/tmva10*.py)
920+
file(GLOB requires_xgboost RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
921+
machine_learning/tmva101_Training.py
922+
roofit/roofit/rf618_mixture_models.py
923+
)
927924
file(GLOB requires_sklearn RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
928925
machine_learning/TMVA_SOFIE_Models.py
926+
machine_learning/tmva101_Training.py # uses the xgboost sklearn plugin
929927
roofit/roofit/rf617_simulation_based_inference_multidimensional.py
928+
roofit/roofit/rf618_mixture_models.py # uses the xgboost sklearn plugin
930929
)
931930
file(GLOB requires_tensorflow RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
932931
machine_learning/RBatchGenerator_TensorFlow.py

0 commit comments

Comments
 (0)