ef51899
# make main package noarch to run tests on all arches
ef51899
# but the package is actually noarch, so don't generate debuginfo
ef51899
%global debug_package %{nil}
ef51899
7c766bb
%global desc %{expand: \
7c766bb
Nilearn is a Python module for fast and easy statistical learning on
7c766bb
NeuroImaging data.
7c766bb
7c766bb
It leverages the scikit-learn Python toolbox for multivariate statistics with
7c766bb
applications such as predictive modelling, classification, decoding, or
7c766bb
connectivity analysis.
7c766bb
7c766bb
This work is made available by a community of people, amongst which the INRIA
7c766bb
Parietal Project Team and the scikit-learn folks, in particular P. Gervais, A.
7c766bb
Abraham, V. Michel, A. Gramfort, G. Varoquaux, F. Pedregosa, B. Thirion, M.
7c766bb
Eickenberg, C. F. Gorgolewski, D. Bzdok, L. Esteve and B. Cipollini.
7c766bb
7c766bb
Detailed documentation is available at http://nilearn.github.io/.}
7c766bb
a99a4ea
%global forgeurl https://github.com/nilearn/nilearn
a99a4ea
60d19f0
Name:           python-nilearn
Packit 248267c
Version:        0.10.4
60d19f0
Release:        %autorelease
7c766bb
Summary:        Python module for fast and easy statistical learning on NeuroImaging data
7c766bb
a99a4ea
%global tag %{version}
a99a4ea
%forgemeta
a99a4ea
c105ed9
# SPDX
c105ed9
License:        BSD-3-Clause
a99a4ea
URL:            %forgeurl
783a2a2
# Use GitHub tar: pypi does not include all test data
a99a4ea
Source0:        %forgesource
7c766bb
5578f47
# Since F40, python-scikit-learn is ExcludeArch: %%{ix86}
5578f47
ExcludeArch:    %{ix86}
5578f47
7c766bb
BuildRequires:  python3-devel
60d19f0
BuildRequires:  %{py3_dist pytest}
8deb348
BuildRequires:  git-core
c76c8f1
# For tests
c76c8f1
BuildRequires:  %{py3_dist matplotlib}
c76c8f1
BuildRequires:  %{py3_dist plotly}
60d19f0
c76c8f1
# Dependencies of 'plotting' extra
c76c8f1
# To build the extra, we'd need kaleido in Fedora
c76c8f1
Recommends:     %{py3_dist matplotlib}
c76c8f1
Recommends:     %{py3_dist plotly}
7c766bb
7c766bb
%description
7c766bb
%{desc}
7c766bb
60d19f0
%package -n python3-nilearn
7c766bb
Summary:        %{summary}
ef51899
BuildArch:      noarch
7c766bb
60d19f0
%description -n python3-nilearn
7c766bb
%{desc}
7c766bb
7c766bb
%prep
a99a4ea
%forgesetup
6b9e2b0
export SETUPTOOLS_SCM_PRETEND_VERSION='%{version}'
6b9e2b0
7c766bb
# Remove shebangs
7c766bb
find . -name "*py" -exec sed -i '/#!\/usr\/bin\/env python/ d' '{}' \;
7c766bb
# Remove pre-compiled files
7c766bb
find . -name "*pyc" -exec rm -f '{}' \;
7c766bb
60d19f0
# Correct python command
60d19f0
sed -i 's/python/python3/' nilearn/plotting/html_document.py
783a2a2
#sed -i 's/python/python3/' nilearn/plotting/glass_brain_files/generate_json.sh
60d19f0
60d19f0
%generate_buildrequires
a99a4ea
export SETUPTOOLS_SCM_PRETEND_VERSION='%{version}'
60d19f0
%pyproject_buildrequires -r
60d19f0
7c766bb
%build
6b9e2b0
export SETUPTOOLS_SCM_PRETEND_VERSION='%{version}'
60d19f0
%pyproject_wheel
7c766bb
7c766bb
# Documentation also fetches imaging data set from online sources, so we cannot
7c766bb
# generate it. We include the link to the documentation in the description.
7c766bb
7c766bb
%install
6b9e2b0
export SETUPTOOLS_SCM_PRETEND_VERSION='%{version}'
60d19f0
%pyproject_install
a0e1f47
%pyproject_save_files -l nilearn
7c766bb
7c766bb
%check
ef51899
c23ebf7
%ifarch s390x %{power64} %{arm64}
ef51899
# https://github.com/nilearn/nilearn/issues/3232
783a2a2
k="${k:-}${k:+ and} not test_load_confounds"
c23ebf7
e0766df
k="${k:-}${k:+ and} not test_tfce_smoke"
e0766df
%endif
783a2a2
c76c8f1
# Fails with obscure error:
c76c8f1
# _flapack.error: (liwork>=max(1,10*n)||liwork==-1) failed for 10th keyword liwork: dsyevr:liwork=1
c76c8f1
k="${k:-}${k:+ and} not test_percentile_range"
c76c8f1
# Requires kaleido (not available in Fedora)
c76c8f1
k="${k:-}${k:+ and} not test_plot_surf[plotly]"
c76c8f1
%{pytest} -v -k "${k:-}" nilearn
7c766bb
60d19f0
%files -n python3-nilearn -f %{pyproject_files}
a0e1f47
%doc README.rst
7c766bb
7c766bb
%changelog
60d19f0
%autochangelog