diff --git a/python-mne.spec b/python-mne.spec index 533ebf3..63e0bda 100644 --- a/python-mne.spec +++ b/python-mne.spec @@ -116,86 +116,62 @@ statistics. Python 3 version. %prep -%setup -q -c +%autosetup -n %{modname}-python-%{version} -mv %{modname}-python-%{version} python2 - -pushd python2/mne/externals/ +pushd %{modname}/externals/ # Remove bundled six, jdcal, decorator, tempita, h5io # Save bundled FieldTrip (can't find upstream) rm -rf six.py jdcal.py decorator.py tempita/ h5io/ echo > __init__.py [ $(find -maxdepth 1 -mindepth 1 | grep -v FieldTrip.py | grep -v __init__.py | wc -l) -eq 0 ] || exit 1 popd - -pushd python2/ - # use all six/jdcal/decorator/h5io from system - # fix API change for jdjcal/jcal2jd - find -type f -name '*.py' -exec sed -i \ - -e "s/from mne.externals.six/from six/" \ - -e "s/from \.*externals.six/from six/" \ - -e "s/from mne.externals import six/import six/" \ - -e "s/from \.*externals import six/import six/" \ - -e "s/from \.*externals.jdcal/from jdcal/" \ - -e "s/from \.*externals.decorator/from decorator/" \ - -e "s/from \.*externals.h5io/from h5io/" \ - -e "s/from \.*externals.tempita/from tempita/" \ - -e "s/jd2jcal(\(.*\))/jd2jcal(\1, 0)[:-1]/" \ - -e "s/(jcal2jd(\(.*\)))/(jcal2jd(\1)[-1])/" \ - {} ';' - sed -i -e "/mne\.externals\.[^']*/d" setup.py -popd - -cp -a python2 python3 -find python2/%{modname}/commands/ -name '*.py' | xargs sed -i '1s|^#!.*$|#!%{__python2}|' -find python3/%{modname}/commands/ -name '*.py' | xargs sed -i '1s|^#!.*$|#!%{__python3}|' +# use all six/jdcal/decorator/h5io from system +# fix API change for jdjcal/jcal2jd +find -type f -name '*.py' -exec sed -i \ + -e "s/from mne.externals.six/from six/" \ + -e "s/from \.*externals.six/from six/" \ + -e "s/from mne.externals import six/import six/" \ + -e "s/from \.*externals import six/import six/" \ + -e "s/from \.*externals.jdcal/from jdcal/" \ + -e "s/from \.*externals.decorator/from decorator/" \ + -e "s/from \.*externals.h5io/from h5io/" \ + -e "s/from \.*externals.tempita/from tempita/" \ + -e "s/jd2jcal(\(.*\))/jd2jcal(\1, 0)[:-1]/" \ + -e "s/(jcal2jd(\(.*\)))/(jcal2jd(\1)[-1])/" \ + {} ';' +sed -i -e "/mne\.externals\.[^']*/d" setup.py + +sed -i -e '1{\@^#!/usr/bin/env python@d}' %{modname}/commands/*.py +sed -i -e '1s|^#!.*$|#!%{__python3}|' bin/%{modname} #cp -p %{SOURCE1} . #python -c "import mne; mne.datasets.sample.data_path(verbose=True, download=False)" %build -pushd python2 - %py2_build -popd -pushd python3 - %py3_build -popd +%py2_build +%py3_build %install -pushd python2 - %py2_install -popd -pushd python3 - %py3_install -popd - -sed -i -e '1{\@^#!/usr/bin/env python@d}' \ - %{buildroot}%{python2_sitelib}/%{modname}/commands/*.py \ - %{buildroot}%{python3_sitelib}/%{modname}/commands/*.py - -sed -i '1s|^#!.*$|#!%{__python3}|' %{buildroot}%{_bindir}/%{modname} +%py2_install +%py3_install %check export MNE_SKIP_TESTING_DATASET_TESTS=true export MNE_SKIP_NETWORK_TESTS=1 # In koji it is timing out %global to_skip test_spectral_connectivity -pushd python2 - nosetests-%{python2_version} -v %{?to_skip:-e %{to_skip}} || : -popd -pushd python3 - nosetests-%{python3_version} -v %{?to_skip:-e %{to_skip}} || : -popd +nosetests-%{python2_version} -v %{?to_skip:-e %{to_skip}} || : +nosetests-%{python3_version} -v %{?to_skip:-e %{to_skip}} || : %files -n python2-%{modname} -%license python2/LICENSE.txt -%doc python2/README.rst python2/examples python2/AUTHORS.rst +%license LICENSE.txt +%doc README.rst examples AUTHORS.rst %{python2_sitelib}/%{modname}/ %{python2_sitelib}/%{modname}-*.egg-info/ %files -n python3-%{modname} -%license python3/LICENSE.txt -%doc python3/README.rst python3/examples python3/AUTHORS.rst +%license LICENSE.txt +%doc README.rst examples AUTHORS.rst %{_bindir}/%{modname} %{python3_sitelib}/%{modname}/ %{python3_sitelib}/%{modname}-*.egg-info/