# setup.py does not list all requirements, and we also unbundle quite a few # from the externals folder, so we can't only rely on the automatic generator # here. # Additionally, requirements.txt seems to be dev requirements, and is not used # in setup.py for install_requires. %global modname mne Name: python-%{modname} Version: 0.24.1 Release: %autorelease Summary: Magnetoencephalography (MEG) and Electroencephalography (EEG) data analysis # Bundled FieldTrip # https://github.com/fieldtrip/fieldtrip/blob/master/realtime/src/buffer/python/FieldTrip.py # Not possible to package because it is matlab package with some plugins License: BSD URL: http://martinos.org/mne/ Source0: https://github.com/mne-tools/mne-python/archive/v%{version}/%{name}-%{version}.tar.gz #Source1: https://s3.amazonaws.com/mne-python/datasets/MNE-sample-data-processed.tar.gz BuildArch: noarch BuildRequires: python3-devel %global _description %{expand: This package is designed for sensor- and source-space analysis of M-EEG data, including frequency-domain and time-frequency analyses and non-parametric statistics.} %description %_description %package -n python3-%{modname} Summary: %{summary} %{?python_provide:%python_provide python3-%{modname}} Provides: bundled(bootstrap) Provides: bundled(js-jquery) Provides: bundled(js-jquery-ui) Provides: bundled(js-d3) Provides: bundled(js-mpld3) Provides: bundled(python3-FieldTrip) BuildRequires: python3-setuptools BuildRequires: python3-numpy BuildRequires: python3-scipy # Test deps BuildRequires: python3-pytest BuildRequires: python3-pytest-cov BuildRequires: python3-pytest-mock BuildRequires: python3-pytest-xdist BuildRequires: python3-pytest-timeout BuildRequires: python3-matplotlib BuildRequires: python3-pandas BuildRequires: python3-h5py BuildRequires: python3-decorator BuildRequires: python3-pymatreader BuildRequires: python3-h5io BuildRequires: python3-tempita BuildRequires: python3-scikit-learn BuildRequires: python3-Traits BuildRequires: python3-tqdm BuildRequires: python3-nibabel BuildRequires: python3-nilearn BuildRequires: python3-qt5 BuildRequires: python3-dipy BuildRequires: python3-xlrd BuildRequires: python3-nitime Requires: python3-matplotlib Requires: python3-decorator Requires: python3-h5io Requires: python3-six Requires: python3-tempita Requires: python3-tqdm Requires: python3-pymatreader Recommends: python3-scikit-learn Recommends: python3-pandas Recommends: python3-patsy Recommends: python3-pillow Recommends: python3-h5py Recommends: python3-statsmodels Recommends: python3-Traits # Should be included by the dep generator as they're mentioned in setup.py # Requires: python3-numpy # Requires: python3-scipy %description -n python3-%{modname} %_description %prep %autosetup -n %{modname}-python-%{version} %generate_buildrequires %pyproject_buildrequires -r #pushd %{modname}/externals/ # Remove bundled six, tqdm, decorator, tempita, h5io # Save bundled FieldTrip (can't find upstream) #rm -rf decorator.py doccer.py pymatreader/ tempita/ h5io/ tqdm/ # Check that only {FieldTrip,__init__}.py remain #[ $(find -maxdepth 1 -mindepth 1 | grep -v FieldTrip.py | grep -v __init__.py | wc -l) -eq 0 ] || exit 1 #popd # use all six/tqdm/decorator/h5io/pymatreader 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.decorator/from decorator/" \ -e "s/from mne.externals.h5io/from h5io/" \ -e "s/from \.*externals.h5io/from h5io/" \ -e "s/from \.*externals.tempita/from tempita/" \ -e "s/from \.*externals.pymatreader/from pymatreader/" \ -e "s/from mne.externals.pymatreader/from pymatreader/" \ -e "s/from \.*.externals.tqdm/from tqdm/" \ -e "s/from mne.externals.tqdm/from tqdm/" \ -e "s/from \.*externals import tqdm/import tqdm\n from tqdm import auto/"\ -e "s/from \.*externals.doccer/from scipy.misc.doccer/" \ -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 #cp -p %{SOURCE1} . #python -c "import mne; mne.datasets.sample.data_path(verbose=True, download=False)" %build %pyproject_wheel %install %pyproject_install %pyproject_save_files mne %check export MNE_SKIP_TESTING_DATASET_TESTS=true export MNE_SKIP_NETWORK_TESTS=1 export MNE_DONTWRITE_HOME=true export MNE_FORCE_SERIAL=true export PYTHONPATH=%{buildroot}%{python3_sitearch} # Deselected tests require additional data or don't work in mock # Two deselected for sklearn warnings # Tools directory ignored as it contains tests for upstream release process pytest-%{python3_version}\ --deselect mne/utils/tests/test_logging.py\ --deselect mne/tests/test_report.py\ --deselect mne/beamformer/tests/test_lcmv.py\ --deselect mne/io/curry/tests/test_curry.py\ --deselect mne/io/tests/test_meas_info.py\ --deselect mne/tests/test_chpi.py\ --deselect mne/viz/tests/test_topomap.py\ --deselect mne/preprocessing/tests/test_peak_finder.py\ --deselect mne/io/tests/test_constants.py\ --deselect mne/datasets/tests/test_datasets.py\ --ignore tools %files -n python3-%{modname} -f %{pyproject_files} %license LICENSE.txt %doc README.rst examples %{_bindir}/%{modname} %changelog %autochangelog