95761a0
# All tests run
95761a0
%bcond_without tests
a1cc908
86f2857
%if 0%{?fedora} >= 33 || 0%{?rhel} >= 9
86f2857
%global blaslib flexiblas
86f2857
%else
86f2857
%global blaslib openblas
86f2857
%endif
86f2857
09965ff
%global modname nipy
09965ff
09965ff
%global _docdir_fmt %{name}
09965ff
09965ff
Name:           python-%{modname}
95761a0
Version:        0.5.0
4975f6e
Release:        3%{?dist}
09965ff
Summary:        Neuroimaging in Python FMRI analysis package
09965ff
09965ff
License:        BSD
09965ff
URL:            http://nipy.org/nipy
09965ff
Source0:        https://github.com/nipy/nipy/archive/%{version}/%{modname}-%{version}.tar.gz
09965ff
BuildRequires:  git-core
09965ff
BuildRequires:  gcc
86f2857
BuildRequires:  %{blaslib}-devel
09965ff
09965ff
%description
09965ff
Neuroimaging tools for Python.
09965ff
09965ff
The aim of NIPY is to produce a platform-independent Python environment for the
09965ff
analysis of functional brain imaging data using an open development model.
09965ff
09965ff
%package -n python3-%{modname}
09965ff
Summary:        %{summary}
09965ff
BuildRequires:  python3-devel python3-setuptools
09965ff
BuildRequires:  python3-numpy python3-scipy python3-nibabel python3-sympy
09965ff
BuildRequires:  python3-Cython
09965ff
# Test deps
a1cc908
%if %{with tests}
09965ff
BuildRequires:  python3-nose
fe24139
BuildRequires:  python3-six
fe24139
BuildRequires:  python3-transforms3d
09965ff
BuildRequires:  nipy-data
a1cc908
%endif
fe24139
Requires:       python3-configobj
fe24139
Requires:       python3-numpy
fe24139
Requires:       python3-scipy
fe24139
Requires:       python3-nibabel
fe24139
Requires:       python3-sympy
fe24139
Requires:       python3-six
fe24139
Requires:       python3-transforms3d
09965ff
Requires:       python3-matplotlib
09965ff
Suggests:       nipy-data
09965ff
09965ff
%description -n python3-%{modname}
09965ff
Neuroimaging tools for Python.
09965ff
09965ff
The aim of NIPY is to produce a platform-independent Python environment for the
09965ff
analysis of functional brain imaging data using an open development model.
09965ff
09965ff
Python 3 version.
09965ff
09965ff
%prep
95761a0
%autosetup -n %{modname}-%{version}
09965ff
09965ff
# Hard fix for bundled libs
09965ff
find -type f -name '*.py' -exec sed -i \
09965ff
  -e "s/from \.*externals.six/from six/"                             \
09965ff
  -e "s/from nipy.externals.six/from six/"                           \
09965ff
  -e "s/from nipy.externals import six/import six/"                  \
09965ff
  -e "s/from nipy.externals.argparse/from argparse/"                 \
09965ff
  -e "s/import nipy.externals.argparse as argparse/import argparse/" \
09965ff
  -e "s/from \.*externals.transforms3d/from transforms3d/"           \
09965ff
  {} ';'
09965ff
sed -i -e "/config.add_subpackage(.externals.)/d" nipy/setup.py
09965ff
rm -vrf nipy/externals/
09965ff
rm -rf lib/lapack_lite/
09965ff
9a90368
find examples -type f -name '*.py' -exec sed -i '1{\@^#!/usr/bin/env python@d}' {} ';'
9a90368
09965ff
%build
09965ff
export NIPY_EXTERNAL_LAPACK=1
09965ff
09965ff
%py3_build
09965ff
09965ff
%install
09965ff
export NIPY_EXTERNAL_LAPACK=1
09965ff
09965ff
%py3_install
09965ff
09965ff
find %{buildroot}%{python3_sitearch} -name '*.so' -exec chmod 755 {} ';'
09965ff
fe24139
find %{buildroot}%{python3_sitearch}/%{modname}/ -name '*.py' -type f > tmp
09965ff
while read lib
09965ff
do
09965ff
 sed -i '1{\@^#!/usr/bin/env python@d}' $lib
09965ff
done < tmp
09965ff
rm -f tmp
09965ff
09965ff
%check
a1cc908
%if %{with tests}
ead1986
TESTING_DATA=(                                             \
09965ff
nipy/testing/functional.nii.gz                             \
09965ff
nipy/modalities/fmri/tests/spm_hrfs.mat                    \
09965ff
nipy/modalities/fmri/tests/spm_dmtx.npz                    \
09965ff
nipy/testing/anatomical.nii.gz                             \
09965ff
nipy/algorithms/statistics/models/tests/test_data.bin      \
09965ff
nipy/algorithms/diagnostics/tests/data/tsdiff_results.mat  \
09965ff
nipy/modalities/fmri/tests/spm_bases.mat                   \
ead1986
nipy/labs/spatial_models/tests/some_blobs.nii              \
ead1986
nipy/modalities/fmri/tests/cond_test1.txt                  \
ead1986
nipy/modalities/fmri/tests/dct_5.txt                       \
ead1986
nipy/modalities/fmri/tests/dct_10.txt                      \
ead1986
nipy/modalities/fmri/tests/dct_100.txt                     \
09965ff
)
09965ff
fe24139
# It seems like this is checking some internals of sympy that were changed:
fe24139
%global skip_tests test_implemented_function
09965ff
09965ff
pushd build/lib.*-%{python3_version}
09965ff
  for i in ${TESTING_DATA[@]}
09965ff
  do
09965ff
    mkdir -p ./${i%/*}/
09965ff
    cp -a ../../$i ./$i
09965ff
  done
95761a0
  PATH="%{buildroot}%{_bindir}:$PATH" PYTHONPATH="%{buildroot}/%{python3_sitearch}" nosetests-%{python3_version} -v %{?skip_tests:-e %{skip_tests}}
09965ff
popd
a1cc908
%endif
09965ff
09965ff
%files -n python3-%{modname}
09965ff
%license LICENSE
09965ff
%doc README.rst AUTHOR THANKS examples
09965ff
%{_bindir}/nipy_3dto4d
09965ff
%{_bindir}/nipy_4d_realign
09965ff
%{_bindir}/nipy_4dto3d
09965ff
%{_bindir}/nipy_diagnose
09965ff
%{_bindir}/nipy_tsdiffana
09965ff
%{python3_sitearch}/%{modname}*
09965ff
09965ff
%changelog
4975f6e
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.0-3
4975f6e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
4975f6e
ca71c4d
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.0-2
ca71c4d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
ca71c4d
95761a0
* Sun Jul 04 2021 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.5.0-1
95761a0
- Update to latest release
95761a0
- remove unneeded explicity provides
95761a0
- remove s390x test exlusions
95761a0
- Enable all tests
95761a0
3b39588
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 0.4.2-13
3b39588
- Rebuilt for Python 3.10
3b39588
034bab8
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.2-12
034bab8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
034bab8
86f2857
* Sun Aug 16 2020 Iñaki Úcar <iucar@fedoraproject.org> - 0.4.2-11
86f2857
- https://fedoraproject.org/wiki/Changes/FlexiBLAS_as_BLAS/LAPACK_manager
86f2857
a1cc908
* Thu Aug 13 2020 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.4.2-10
a1cc908
- Temporarily disable tests
a1cc908
- #1800845
a1cc908
0215b51
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.2-9
0215b51
- Second attempt - Rebuilt for
0215b51
  https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
0215b51
4342130
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.2-8
4342130
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
4342130
c8b7124
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 0.4.2-7
c8b7124
- Rebuilt for Python 3.9
c8b7124
352ed44
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.2-6
352ed44
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
352ed44
66826a0
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 0.4.2-5
66826a0
- Rebuilt for Python 3.8.0rc1 (#1748018)
66826a0
091ccd4
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 0.4.2-4
091ccd4
- Rebuilt for Python 3.8
091ccd4
360aa47
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.2-3
360aa47
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
360aa47
65952e4
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.2-2
65952e4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
65952e4
fe24139
* Tue Aug 14 2018 Miro Hrončok <mhroncok@redhat.com> - 0.4.2-1
fe24139
- Update to 0.4.2
fe24139
- Remove python2 subpackage
fe24139
cf13820
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.1-7
cf13820
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
cf13820
865ee6f
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.4.1-6
865ee6f
- Rebuilt for Python 3.7
865ee6f
83f1120
* Mon Mar 26 2018 Iryna Shcherbina <ishcherb@redhat.com> - 0.4.1-5
83f1120
- Update Python 2 dependency declarations to new packaging standards
83f1120
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
83f1120
2aa735d
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.1-4
2aa735d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
2aa735d
dc4440a
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.1-3
dc4440a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
dc4440a
4eb0922
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.1-2
4eb0922
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
4eb0922
ead1986
* Sun Feb 12 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.4.1-1
ead1986
- Update to latest version
ead1986
f7a415b
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.0-8
f7a415b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
f7a415b
72dbefd
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.4.0-7
72dbefd
- Rebuild for Python 3.6
72dbefd
8a4c1a8
* Sat Oct 15 2016 Peter Robinson <pbrobinson@fedoraproject.org> - 0.4.0-6
8a4c1a8
- rebuilt for matplotlib-2.0.0
8a4c1a8
335e8a8
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.0-5
335e8a8
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
335e8a8
3eb9263
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.0-4
3eb9263
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
3eb9263
09965ff
* Sun Nov 29 2015 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 0.4.0-3
09965ff
- Use one directory for building
09965ff
09965ff
* Sat Nov 28 2015 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 0.4.0-2
09965ff
- Do not use obsolete py3dir
09965ff
- Have only one binary
09965ff
09965ff
* Sun Nov 01 2015 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 0.4.0-1
09965ff
- Initial package