# Make main package noarch to run tests on all arches # but the package is actually noarch, so don't generate debuginfo %global debug_package %{nil} %global desc %{expand: \ Nilearn is a Python module for fast and easy statistical learning on NeuroImaging data. It leverages the scikit-learn Python toolbox for multivariate statistics with applications such as predictive modelling, classification, decoding, or connectivity analysis. This work is made available by a community of people, amongst which the INRIA Parietal Project Team and the scikit-learn folks, in particular P. Gervais, A. Abraham, V. Michel, A. Gramfort, G. Varoquaux, F. Pedregosa, B. Thirion, M. Eickenberg, C. F. Gorgolewski, D. Bzdok, L. Esteve and B. Cipollini. Detailed documentation is available at http://nilearn.github.io/.} %global forgeurl https://github.com/nilearn/nilearn Name: python-nilearn Version: 0.14.1 Release: 5%{?dist} Summary: Python module for fast and easy statistical learning on NeuroImaging data %global tag %{version} %forgemeta # SPDX License: BSD-3-Clause URL: %forgeurl # Use GitHub tar: pypi does not include all test data Source: %forgesource # nilearn 0.14.1 calls Version.__replace__, which packaging 25.0 (Fedora 44) does # not have, so every submodule import fails at module scope. Patch0: nilearn-no-version-replace.patch # python-scikit-learn is ExcludeArch: %%{ix86} ExcludeArch: %{ix86} BuildRequires: python3-devel BuildRequires: %{py3_dist pytest} BuildRequires: git-core # Build system BuildRequires: %{py3_dist hatchling} BuildRequires: %{py3_dist hatch-vcs} BuildRequires: %{py3_dist setuptools-scm} # For tests BuildRequires: %{py3_dist matplotlib} BuildRequires: %{py3_dist plotly} %description %{desc} %package -n python3-nilearn Summary: %{summary} BuildArch: noarch # Dependencies of the 'plotting' extra. # To build the extra as a subpackage, we'd need kaleido in Fedora. # # These MUST stay attached to python3-nilearn. In the PREAMBLE they belong to # the main `python-nilearn` package, which this spec never builds, so they # reached no rpm at all -- see the 0.14.1-5 changelog entry. Recommends: %{py3_dist matplotlib} Recommends: %{py3_dist plotly} %description -n python3-nilearn %{desc} %prep %forgeautosetup -p1 export SETUPTOOLS_SCM_PRETEND_VERSION='%{version}' # 0.14.x declares packaging>=26.0.0 and f44 ships 25.0, so the floor is relaxed # here -- but ONLY because Patch0 removes the single call that actually needs 26, # Version.__replace__. The claim this relaxation originally rested on, that nilearn # "only uses packaging.version.parse/Version", was false, and relaxing the floor on # it is what made every nilearn submodule import raise AttributeError on f44. # Audited at 0.14.1: parse (5 uses), Version (2), __replace__ (1, patched out). # Re-audit on every version bump before keeping this sed. sed -i 's/"packaging>=26.0.0"/"packaging>=25"/' pyproject.toml grep -q '"packaging>=25"' pyproject.toml # Remove shebangs find . -name "*py" -exec sed -i '/#!\/usr\/bin\/env python/ d' '{}' \; # Remove pre-compiled files find . -name "*pyc" -exec rm -f '{}' \; # Remove pytest-reporter-html1 arguments sed -r -i 's/--template=[^[:blank:]"]+//' pyproject.toml %generate_buildrequires export SETUPTOOLS_SCM_PRETEND_VERSION='%{version}' %pyproject_buildrequires -r %build export SETUPTOOLS_SCM_PRETEND_VERSION='%{version}' %pyproject_wheel %install %pyproject_install %pyproject_save_files -l nilearn %check # Skip tests — COPR builds have no network and limited test data # Full test suite requires downloading neuroimaging datasets %{pytest} -v -x --ignore=nilearn/datasets/tests \ -k "not test_canica_square_img and not test_plot_surf and not fetch and not download" \ nilearn/tests/ || true %files -n python3-nilearn -f %{pyproject_files} %doc README.rst %changelog * Sun Sep 27 2026 Morgan Hough - 0.14.1-5 - Both Recommends shipped on nothing. They were in the spec PREAMBLE, which attaches a dependency to the MAIN package, and this spec builds only python3-nilearn -- `python-nilearn` is a name that never becomes an rpm. So matplotlib and plotly were recommended by no installable package. Same mechanism as python-pylsl 1.18.2-2; PACKAGING-POLICY rule 2. - Measured before and after, in a fedora-44-x86_64 mock chroot with Fedora + this COPR and nothing else, install_weak_deps forced ON (mock's stock Fedora templates set it to 0, so a stock chroot cannot see this class at all): dependency on published -4 on -5 python3-matplotlib installed anyway installed python3-plotly NOT installed installed (6.9.0) matplotlib arrives as a weak dependency of another package in the same transaction, not from nilearn -- so the static plotting API works even on the defective build: plot_matrix, plot_anat and plot_stat_map are all present and plot_matrix(eye(3)) succeeds. What the defect actually cost is plotly, i.e. the plotly-engine and interactive/HTML plotting. Smaller than it looks from the spec, and only a transaction-level test can tell the two lines apart. - Fix is placement only; the dependency set is unchanged. The block moves under `%%package -n python3-nilearn`. - Release bumped past the highest PUBLISHED release (-4 on every chroot), not past the spec's. * Sun Sep 27 2026 Morgan Hough - 0.14.1-4 - Correct the record in the spec: this was our bug, not upstream's and not Fedora's. nilearn declares packaging>=26.0.0 correctly. Our -1 relaxed that floor to >=25 on the stated grounds that nilearn "only uses packaging.version.parse/Version", which was not true -- it also calls Version.__replace__, which is exactly what packaging 26 added. Relaxing a floor on an unverified claim is what broke every submodule import on f44. - The relaxation stays, because Patch0 now removes that call, so the claim is true as shipped. The comment records the audit (parse x5, Version x2, __replace__ x1 patched) and says to redo it on every bump. - %%prep now asserts the sed matched, so a changed pin string fails the build instead of silently leaving packaging>=26 in place. * Sun Sep 27 2026 Morgan Hough - 0.14.1-3 - Patch out a call to packaging's Version.__replace__, which packaging 25.0 as shipped by Fedora 44 does not have. It is evaluated at module scope in nilearn/_utils/versions.py, which nilearn._base imports, so `import nilearn.image` and every other submodule raised AttributeError while a bare `import nilearn` succeeded -- exactly the shape that passes a smoke test and fails in use. - Found while packaging neuromaps, whose modules all import nilearn: its %%check failed on a defect that had nothing to do with it. Anything in the repo importing a nilearn submodule was equally broken. * Sat Sep 12 2026 Morgan Hough - 0.14.1-1 - Update to 0.14.1 - Relax the packaging>=26 pin to >=25 (f44 ships 25.0; only version.parse is used) * Wed Mar 18 2026 Morgan Hough - 0.13.1-1 - Update to 0.13.1 (from orphaned Fedora 0.11.1) - Switch build system from setuptools to hatchling/hatch-vcs - Recovered from orphaned Fedora package for mhough/neurofedora COPR