From 4d457a27df5913a9562378568a2b2abe23092690 Mon Sep 17 00:00:00 2001 From: Jonas Rembser Date: Tue, 27 Oct 2026 07:55:12 +0100 Subject: [PATCH] [Python] Enable all ROOT Python tests on Windows After the LLVM and cppjit upgrades, we can enable all ROOT Python tests on Windows, with minimal changes. --- .../pyroot/pythonizations/test/CMakeLists.txt | 25 ++++++------------- .../pyroot/pythonizations/test/string_view.py | 3 +++ roottest/python/JupyROOT/CMakeLists.txt | 5 ---- roottest/python/basic/CMakeLists.txt | 2 -- roottest/python/cpp/CMakeLists.txt | 2 -- roottest/python/numba/CMakeLists.txt | 7 ++---- roottest/python/pythonizations/CMakeLists.txt | 5 +--- 7 files changed, 14 insertions(+), 35 deletions(-) diff --git a/bindings/pyroot/pythonizations/test/CMakeLists.txt b/bindings/pyroot/pythonizations/test/CMakeLists.txt index 560d30daf4430..e40a2175e84c4 100644 --- a/bindings/pyroot/pythonizations/test/CMakeLists.txt +++ b/bindings/pyroot/pythonizations/test/CMakeLists.txt @@ -91,9 +91,7 @@ ROOT_ADD_PYUNITTEST(pyroot_pyz_misc misc_pyz.py) # RVec and subclasses pythonizations ROOT_ADD_PYUNITTEST(pyroot_pyz_rvec rvec.py) -if(NOT MSVC OR win_broken_tests) - ROOT_ADD_PYUNITTEST(pyroot_pyz_rvec_asrvec rvec_asrvec.py PYTHON_DEPS numpy) -endif() +ROOT_ADD_PYUNITTEST(pyroot_pyz_rvec_asrvec rvec_asrvec.py PYTHON_DEPS numpy) # RDataFrame and subclasses pythonizations if (dataframe) @@ -117,14 +115,12 @@ if(roofit) endif() if (dataframe) - if(NOT MSVC OR win_broken_tests) - # Test wrapping Python callables for use in C++ using numba - ROOT_ADD_PYUNITTEST(pyroot_numbadeclare numbadeclare.py PYTHON_DEPS numba) - ROOT_ADD_PYUNITTEST(pyroot_rdf_filter_pyz rdf_filter_pyz.py PYTHON_DEPS numba) - ROOT_ADD_PYUNITTEST(pyroot_rdf_define_pyz rdf_define_pyz.py PYTHON_DEPS numba) - # std::string_view in CPyCppyy - ROOT_ADD_PYUNITTEST(pyroot_string_view string_view.py) - endif() + # Test wrapping Python callables for use in C++ using numba + ROOT_ADD_PYUNITTEST(pyroot_numbadeclare numbadeclare.py PYTHON_DEPS numba) + ROOT_ADD_PYUNITTEST(pyroot_rdf_filter_pyz rdf_filter_pyz.py PYTHON_DEPS numba) + ROOT_ADD_PYUNITTEST(pyroot_rdf_define_pyz rdf_define_pyz.py PYTHON_DEPS numba) + # std::string_view in CPyCppyy + ROOT_ADD_PYUNITTEST(pyroot_string_view string_view.py) endif() # Tests with memory usage @@ -143,9 +139,4 @@ ROOT_ADD_PYUNITTEST(package_metadata package_metadata.py) ROOT_ADD_PYUNITTEST(regression_23728 regression_23728.py) -if(NOT MSVC OR CMAKE_SIZEOF_VOID_P EQUAL 8 OR win_broken_tests) - # Test the conversion and low level views of interpreter-defined C++ arrays to NumPy - # We do not run this test on Windows x86 due to an interpreter issue with arrays: - # https://github.com/root-project/root/issues/9809 - ROOT_ADD_PYUNITTEST(pyroot_array_numpy_views array_conversions.py PYTHON_DEPS numpy) -endif() +ROOT_ADD_PYUNITTEST(pyroot_array_numpy_views array_conversions.py PYTHON_DEPS numpy) diff --git a/bindings/pyroot/pythonizations/test/string_view.py b/bindings/pyroot/pythonizations/test/string_view.py index 1f3ff4188c2e9..5435a02624d3b 100644 --- a/bindings/pyroot/pythonizations/test/string_view.py +++ b/bindings/pyroot/pythonizations/test/string_view.py @@ -27,6 +27,9 @@ def test_rdataframe(self): df = ROOT.RDataFrame(treename, filename) self.assertEqual(df.GetNRuns(), 0) + # The RDataFrame keeps the file open; release it before removing the + # file, which otherwise fails on Windows. + del df os.remove(filename) if __name__ == '__main__': diff --git a/roottest/python/JupyROOT/CMakeLists.txt b/roottest/python/JupyROOT/CMakeLists.txt index e984810c82d39..e817d1c4577c9 100644 --- a/roottest/python/JupyROOT/CMakeLists.txt +++ b/roottest/python/JupyROOT/CMakeLists.txt @@ -1,6 +1,3 @@ -#disable until JupyROOT works on Windows -if(NOT MSVC OR win_broken_tests) - # Do not run with classic build or if tests are vetoed if (pyroot AND NOT ROOT_CLASSIC_BUILD) @@ -62,5 +59,3 @@ ROOTTEST_ADD_TEST(${NOTEBOOKBASE}_notebook PYTHON_DEPS jupyter) endif() - -endif() diff --git a/roottest/python/basic/CMakeLists.txt b/roottest/python/basic/CMakeLists.txt index ec0958fda664b..006b88c69a368 100644 --- a/roottest/python/basic/CMakeLists.txt +++ b/roottest/python/basic/CMakeLists.txt @@ -3,11 +3,9 @@ if(pyroot) MACRO PyROOT_basictests.py COPY_TO_BUILDDIR SimpleClass.C) -if(NOT MSVC OR win_broken_tests) ROOTTEST_ADD_TEST(datatype-numpy MACRO PyROOT_datatypetest_numpy.py COPY_TO_BUILDDIR DataTypes.C DataTypes.h PRECMD ${ROOT_root_CMD} -b -q -e .L\ DataTypes.C+ PYTHON_DEPS numpy) endif() -endif() diff --git a/roottest/python/cpp/CMakeLists.txt b/roottest/python/cpp/CMakeLists.txt index 024ab1303dc24..e18a04b47e3ec 100644 --- a/roottest/python/cpp/CMakeLists.txt +++ b/roottest/python/cpp/CMakeLists.txt @@ -1,5 +1,4 @@ if(pyroot) -if(NOT MSVC OR win_broken_tests) ROOTTEST_ADD_TEST(cpp MACRO PyROOT_cpptests.py COPY_TO_BUILDDIR Namespace.C @@ -10,4 +9,3 @@ if(NOT MSVC OR win_broken_tests) COPY_TO_BUILDDIR AdvancedCpp.C PRECMD ${ROOT_root_CMD} -b -q -e .L\ AdvancedCpp.C+) endif() -endif() diff --git a/roottest/python/numba/CMakeLists.txt b/roottest/python/numba/CMakeLists.txt index 5f639345af4b8..b285de84a7509 100644 --- a/roottest/python/numba/CMakeLists.txt +++ b/roottest/python/numba/CMakeLists.txt @@ -1,7 +1,4 @@ if(pyroot) - if(NOT MSVC OR win_broken_tests) - ROOTTEST_ADD_TEST(numba - MACRO PyROOT_numbatests.py) - file(COPY vec_lv.root DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) - endif() + ROOTTEST_ADD_TEST(numba MACRO PyROOT_numbatests.py PYTHON_DEPS numba) + file(COPY vec_lv.root DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) endif() diff --git a/roottest/python/pythonizations/CMakeLists.txt b/roottest/python/pythonizations/CMakeLists.txt index dc90493d1896e..b43b0efdc9bfe 100644 --- a/roottest/python/pythonizations/CMakeLists.txt +++ b/roottest/python/pythonizations/CMakeLists.txt @@ -1,6 +1,3 @@ if(pyroot) - if(NOT MSVC OR "${CMAKE_GENERATOR_PLATFORM}" MATCHES "Win32" OR win_broken_tests) - ROOTTEST_ADD_TEST(pythonizations - MACRO PyROOT_pythonizationtest.py) - endif() + ROOTTEST_ADD_TEST(pythonizations MACRO PyROOT_pythonizationtest.py) endif()