diff --git a/root-python-3.15.patch b/root-python-3.15.patch new file mode 100644 index 0000000..a40cf3f --- /dev/null +++ b/root-python-3.15.patch @@ -0,0 +1,38 @@ +From 4171724228a849959542fcb0b0c1ec10d8e94999 Mon Sep 17 00:00:00 2001 +From: Jonas Rembser +Date: Fri, 3 Apr 2026 22:56:04 +0200 +Subject: [PATCH] [Python] Set `__spec__` attribute and not `__cached__` for + ROOT facade + +The Python documentation [1] says: + +> It is strongly recommended that you use module.__spec__.cached instead + of module.__cached__. + +So this commit suggests to transfer the full `__spec__` attribute from +the ROOT module to the facade, instead of `__cached__`. + +This also avoids errors when importing ROOT with Python 3.15, where +`__cached__` will cease to be set or taken into consideration by the +import system or standard library. + +Closes #21787. + +[1] https://docs.python.org/3/reference/datamodel.html#module.__cached__ +--- + bindings/pyroot/pythonizations/python/ROOT/_facade.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/bindings/pyroot/pythonizations/python/ROOT/_facade.py b/bindings/pyroot/pythonizations/python/ROOT/_facade.py +index c22ae40da4c2d..da8b6681ec2f2 100644 +--- a/bindings/pyroot/pythonizations/python/ROOT/_facade.py ++++ b/bindings/pyroot/pythonizations/python/ROOT/_facade.py +@@ -142,7 +142,7 @@ def __init__(self, module, is_ipython): + self.__all__ = module.__all__ + self.__name__ = module.__name__ + self.__file__ = module.__file__ +- self.__cached__ = module.__cached__ ++ self.__spec__ = module.__spec__ + self.__path__ = module.__path__ + self.__doc__ = module.__doc__ + self.__package__ = module.__package__ diff --git a/root.spec b/root.spec index 8c7a55d..6b745ef 100644 --- a/root.spec +++ b/root.spec @@ -34,7 +34,7 @@ Name: root Version: 6.38.04 %global libversion %(cut -d. -f 1-2 <<< %{version}) -Release: 1%{?dist} +Release: 2%{?dist} Summary: Numerical data analysis framework License: LGPL-2.1-or-later @@ -80,6 +80,10 @@ Patch6: %{name}-Save-memory-Do-not-link-to-LLVM-libraries-in-parallel.patch # https://github.com/root-project/root/pull/21604 # https://github.com/root-project/root/pull/21605 Patch7: %{name}-Avoid-additional-python-version-file-to-wrong-location.patch +# Compatibility with Python 3.15 +# https://github.com/root-project/root/issues/21787 +# https://github.com/root-project/root/pull/21790 +Patch8: %{name}-python-3.15.patch BuildRequires: gcc-c++ BuildRequires: gcc-gfortran @@ -1878,6 +1882,7 @@ This package contains a library for histogramming in ROOT 7. %patch -P5 -p1 %patch -P6 -p1 %patch -P7 -p1 +%patch -P8 -p1 # Remove bundled sources in order to be sure they are not used # * afterimage @@ -2191,10 +2196,8 @@ sed -e 's!/usr/bin/env python3!%{__python3}!' \ -e '/import sys/d' \ -e '/import cmdLineUtils/iimport sys' \ -e '/import cmdLineUtils/isys.path.insert(0, "%{_datadir}/%{name}/cli")' \ - -i %{buildroot}%{_bindir}/rootbrowse \ - %{buildroot}%{_bindir}/rootcp \ + -i %{buildroot}%{_bindir}/rootcp \ %{buildroot}%{_bindir}/rooteventselector \ - %{buildroot}%{_bindir}/rootls \ %{buildroot}%{_bindir}/rootmkdir \ %{buildroot}%{_bindir}/rootmv \ %{buildroot}%{_bindir}/rootprint \ @@ -2407,13 +2410,16 @@ tmva-sofie-test-TestCustomModelsFromONNX\$\$" %ifarch %{power64} %if %{?fedora}%{!?fedora:0} >= 42 -# - gtest-tree-ntuple-ntuple-emulated # - gtest-tree-ntuple-ntuple-evolution-shape # waitpid() failed excluded="${excluded}|\ -gtest-tree-ntuple-ntuple-emulated|\ gtest-tree-ntuple-ntuple-evolution-shape" %endif + +# - gtest-tree-ntuple-ntuple-emulated +ยค Random failures +excluded="${excluded}|\ +gtest-tree-ntuple-ntuple-emulated" %endif %ifarch s390x @@ -3442,6 +3448,9 @@ fi %endif %changelog +* Sun Apr 05 2026 Mattias Ellert - 6.38.04-2 +- Compatibility with Python 3.15 + * Fri Mar 13 2026 Mattias Ellert - 6.38.04-1 - Update to 6.38.04 - Rebuild for pythia8 8.3.17