From ca7fc9972c3856f0e0075bfe5bf510f9361f78ad Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Dec 06 2015 11:35:28 +0000 Subject: Initial import Signed-off-by: Igor Gnatenko --- diff --git a/.gitignore b/.gitignore index e69de29..a243718 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/moss-0.3.4.tar.gz diff --git a/0001-do-not-check-dependencies-in-runtime.patch b/0001-do-not-check-dependencies-in-runtime.patch new file mode 100644 index 0000000..7808166 --- /dev/null +++ b/0001-do-not-check-dependencies-in-runtime.patch @@ -0,0 +1,38 @@ +From 3ba703540d8e319037b36071d4fa3b34b966f6c9 Mon Sep 17 00:00:00 2001 +From: Igor Gnatenko +Date: Thu, 5 Nov 2015 08:13:11 +0100 +Subject: [PATCH 1/2] do not check dependencies in runtime + +that list is wrong + +Signed-off-by: Igor Gnatenko +--- + setup.py | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/setup.py b/setup.py +index dcec414..119d40b 100644 +--- a/setup.py ++++ b/setup.py +@@ -49,7 +49,7 @@ if __name__ == "__main__": + '--version', + 'egg_info', + 'clean'))): +- check_dependencies() ++ pass + + setup(name=DISTNAME, + maintainer=MAINTAINER, +@@ -59,8 +59,7 @@ if __name__ == "__main__": + version=VERSION, + URL=URL, + download_url=DOWNLOAD_URL, +- packages=['moss', 'moss.tests', +- 'moss.nipy', 'moss.nipy.volumes', 'moss.nipy.transforms'], ++ packages=['moss', 'moss.tests'], + scripts=["bin/" + s for s in ["check_mni_reg", "recon_movie", + "recon_status", "recon_qc", + "recon_process_stats", "ts_movie"]], +-- +2.6.2 + diff --git a/0002-do-not-treat-nipy-as-part-of-moss.patch b/0002-do-not-treat-nipy-as-part-of-moss.patch new file mode 100644 index 0000000..c555c7f --- /dev/null +++ b/0002-do-not-treat-nipy-as-part-of-moss.patch @@ -0,0 +1,26 @@ +From ced2d7317a76d8081cf9c244317e552a75dd5830 Mon Sep 17 00:00:00 2001 +From: Igor Gnatenko +Date: Thu, 5 Nov 2015 08:13:44 +0100 +Subject: [PATCH 2/2] do not treat nipy as part of moss + +Signed-off-by: Igor Gnatenko +--- + moss/mosaic.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/moss/mosaic.py b/moss/mosaic.py +index 54fe59d..d78c703 100644 +--- a/moss/mosaic.py ++++ b/moss/mosaic.py +@@ -6,7 +6,7 @@ import matplotlib.pyplot as plt + import nibabel as nib + from six import string_types + +-from .nipy import VolumeImg ++from nipy.labs.datasets import VolumeImg + + + class Mosaic(object): +-- +2.6.2 + diff --git a/python-moss.spec b/python-moss.spec new file mode 100644 index 0000000..b8e1850 --- /dev/null +++ b/python-moss.spec @@ -0,0 +1,148 @@ +%global modname moss + +Name: python-%{modname} +Version: 0.3.4 +Release: 3%{?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 + +%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 +* Sun Dec 06 2015 Igor Gnatenko - 0.3.4-3 +- Fix according review + +* Wed Nov 25 2015 Igor Gnatenko - 0.3.4-2 +- Provide only one version of binaries (py3) + +* Thu Nov 05 2015 Igor Gnatenko - 0.3.4-1 +- Initial package diff --git a/sources b/sources index e69de29..b3894bc 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +e7a847215ffc6f0671c6b3a6a1f57aa3 moss-0.3.4.tar.gz