Blob Blame History Raw
%global modname moss

Name:           python-%{modname}
Version:        0.3.4
Release:        7%{?dist}
Summary:        Assorted utilities for neuroimaging and cognitive science

License:        BSD
URL:            https://github.com/mwaskom/moss
Source0:        https://github.com/mwaskom/moss/archive/v%{version}/%{modname}-%{version}.tar.gz
Patch0:         0001-do-not-check-dependencies-in-runtime.patch
Patch1:         0002-do-not-treat-nipy-as-part-of-moss.patch
BuildArch:      noarch

%description
Moss is a library of functions, classes, and scripts to that may be useful for
analyzing scientific data. Because this package is developed for neuroimaging
and cognitive science, there is probably some bias towards applications that
are useful in that domain. However, the functions are intended to be written
in as general and lightweight a fashion as possible.

%package -n python2-%{modname}
Summary:        %{summary}
%{?python_provide:%python_provide python2-%{modname}}
BuildRequires:  python2-devel python2-setuptools
# Test deps
BuildRequires:  python2-nose
%if 0%{?fedora} > 23
BuildRequires:  python2-pandas
BuildRequires:  python2-numpy python2-scipy
%else
BuildRequires:  python-pandas
BuildRequires:  numpy scipy
%endif
BuildRequires:  python2-six
BuildRequires:  python-scikit-learn
BuildRequires:  python-seaborn
BuildRequires:  python-matplotlib
BuildRequires:  python2-nibabel
BuildRequires:  python-statsmodels
BuildRequires:  python2-nipy
%if 0%{?fedora} > 23
Requires:       python2-pandas
Requires:       python2-numpy python2-scipy
%else
Requires:       python-pandas
Requires:       numpy scipy
%endif
Requires:       python2-six
Requires:       python-scikit-learn
Requires:       python-seaborn
Requires:       python-matplotlib
Requires:       python2-nibabel
Requires:       python-statsmodels
Requires:       python2-nipy

%description -n python2-%{modname}
Moss is a library of functions, classes, and scripts to that may be useful for
analyzing scientific data. Because this package is developed for neuroimaging
and cognitive science, there is probably some bias towards applications that
are useful in that domain. However, the functions are intended to be written
in as general and lightweight a fashion as possible.

Python 2 version.

%package -n python3-%{modname}
Summary:        %{summary}
%{?python_provide:%python_provide python3-%{modname}}
BuildRequires:  python3-devel python3-setuptools
# Test deps
BuildRequires:  python3-nose
BuildRequires:  python3-numpy python3-scipy
BuildRequires:  python3-pandas
BuildRequires:  python3-six
BuildRequires:  python3-scikit-learn
BuildRequires:  python3-seaborn
BuildRequires:  python3-matplotlib
BuildRequires:  python3-nibabel
BuildRequires:  python3-statsmodels
BuildRequires:  python3-nipy
Requires:       python3-numpy python3-scipy
Requires:       python3-pandas
Requires:       python3-six
Requires:       python3-scikit-learn
Requires:       python3-seaborn
Requires:       python3-matplotlib
Requires:       python3-nibabel
Requires:       python3-statsmodels
Requires:       python3-nipy

%description -n python3-%{modname}
Moss is a library of functions, classes, and scripts to that may be useful for
analyzing scientific data. Because this package is developed for neuroimaging
and cognitive science, there is probably some bias towards applications that
are useful in that domain. However, the functions are intended to be written
in as general and lightweight a fashion as possible.

Python 3 version.

%prep
%autosetup -n %{modname}-%{version} -p1
# drop bundled nipy
rm -rf moss/nipy/

%build
%py2_build
%py3_build

%install
%py2_install
%py3_install

# Depends on 'freeview' utility
rm %{buildroot}%{_bindir}/recon_qc

sed -i -e '1s,.*,%{_bindir}/python3,' %{buildroot}%{_bindir}/*

%check
# Don't fail here because upstream says:
# Note that some of the statistical tests depend on randomly generated data
# and fail from time to time because of this.
# ignatenkobrain: I got it failing from time to time in COPR
# Disable one of tests for now due to: https://github.com/mwaskom/moss/issues/17
nosetests-%{python2_version} -v -e test_remove_by_group || :
nosetests-%{python3_version} -v -e test_remove_by_group || :

%files -n python2-%{modname}
%license LICENSE
%doc README.md
%{python2_sitelib}/%{modname}*

%files -n python3-%{modname}
%license LICENSE
%doc README.md
%{_bindir}/recon_status
%{_bindir}/recon_movie
%{_bindir}/check_mni_reg
%{_bindir}/recon_process_stats
%{_bindir}/ts_movie
%{python3_sitelib}/%{modname}*

%changelog
* Mon Sep 26 2016 Dominik Mierzejewski <rpm@greysector.net> - 0.3.4-7
- rebuilt for matplotlib-2.0.0

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.4-6
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Thu Jun 16 2016 Igor Gnatenko <ignatenko@redhat.com> - 0.3.4-5
- Python3 binaries should require only python3 (RHBZ #1342502)

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.4-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Sun Dec 06 2015 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 0.3.4-3
- Fix according review

* Wed Nov 25 2015 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 0.3.4-2
- Provide only one version of binaries (py3)

* Thu Nov 05 2015 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 0.3.4-1
- Initial package