Blob Blame History Raw
%if 0%{?fedora} >= 30
# disabled by default
%bcond_with py2
%bcond_without py2

# The test require internet to download data and so cannot be run in koji
# Confirmed all tests pass in mock with network access:
# mock -r fedora-rawhide-x86_64 rebuild ./python-mne-bids-0.1-2.fc29.src.rpm
# --enable-network --rpmbuild-opts="--with tests"
# Test disable
%bcond_with tests

%global pypi_name mne-bids

%global desc %{expand: \
This is a repository for creating BIDS compatible data-sets with MNE.}

Name:           python-%{pypi_name}
Version:        0.3.1
Release:        1%{?dist}

Summary:        Experimental code for BIDS using MNE
License:        BSD
Source0:        %{url}/archive/v%{version}/%{pypi_name}-%{version}.tar.gz
BuildArch:      noarch



%if %{with py2}
%package -n python2-%{pypi_name}
Summary:        %{summary}

BuildRequires:  python2-devel
BuildRequires:  python2-setuptools
BuildRequires:  python2-numpy
BuildRequires:  python2-pandas
BuildRequires:  python2-six
BuildRequires:  python2-scipy
BuildRequires:  python2-nose
BuildRequires:  python2-pytest-shutil
BuildRequires:  python2-matplotlib
BuildRequires:  python2-mne

Requires:  python2-mne
Requires:  python2-numpy
Requires:  python2-pandas
Requires:  python2-six
Requires:  python2-nose
Requires:  python2-scipy
Requires:  python2-pytest-shutil
Requires:  python2-matplotlib

%{?python_provide:%python_provide python2-%{pypi_name}}

%description -n python2-%{pypi_name}

%package -n python3-%{pypi_name}
Summary:        %{summary}

BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
BuildRequires:  python3-numpy
BuildRequires:  python3-pandas
BuildRequires:  python3-six
BuildRequires:  python3-nose
BuildRequires:  python3-scipy
BuildRequires:  python3-pytest-shutil
BuildRequires:  python3-matplotlib
BuildRequires:  python3-mne

Requires:  python3-mne
Requires:  python3-numpy
Requires:  python3-pandas
Requires:  python3-six
Requires:  python3-nose
Requires:  python3-scipy
Requires:  python3-pytest-shutil
Requires:  python3-matplotlib

%{?python_provide:%python_provide python3-%{pypi_name}}

%description -n python3-%{pypi_name}

%autosetup -n %{pypi_name}-%{version}
rm -rf %{pypi_name}.egg-info

sed -i 's/mne.externals.six/six/' mne_bids/

# remove she-bang lines in .py files.
find * -type f -name "*.py" -exec sed -i '/^#![ ]*\/usr\/bin\/.*$/ d' {} 2>/dev/null ';'

%if %{with py2}

%if %{with py2}
rm -rf %{buildroot}%{_bindir}/*

%if %{with tests}
%if %{with py2}
export PYTHONPATH=$RPM_BUILD_ROOT/%{python2_sitelib}
pytest-%{python2_version} mne_bids

export PYTHONPATH=$RPM_BUILD_ROOT/%{python3_sitelib}
pytest-%{python3_version} mne_bids

# Run test require internet
# Example:
# mock -r fedora-rawhide-x86_64 rebuild ./python-mne-bids-0.1-2.fc29.src.rpm --enable-network --rpmbuild-opts="--with tests"

%if %{with py2}
%files -n python2-%{pypi_name}
%license LICENSE
%doc README.rst examples/README.txt

%files -n python3-%{pypi_name}
%license LICENSE
%doc README.rst examples/README.txt

* Fri Dec 27 2019 Luis Bazan <> - 0.3.1-1
- New upstream version

* Tue Aug 20 2019 Miro Hrončok <> - 0.3-2
- Rebuilt for Python 3.8

* Tue Aug 20 2019 Luis M. Segundo <> - 0.3-1
- New upstream version

* Mon Aug 19 2019 Miro Hrončok <> - 0.2-3
- Rebuilt for Python 3.8

* Mon Apr 29 2019 Luis Bazan <> - 0.2-2
- Fix typo

* Mon Apr 29 2019 Luis Bazan <> - 0.2-1
- New upstream version

* Sat Feb 02 2019 Fedora Release Engineering <> - 0.1-3
- Rebuilt for

* Mon Nov 26 2018 Luis Bazan <> - 0.1-2
- Fix comment 1 in BZ 1652976

* Fri Nov 23 2018 Luis Bazan <> - 0.1-1
- New upstream