Blame python-mne-bids.spec

75f048d
%if 0%{?fedora} >= 30
75f048d
# disabled by default
75f048d
%bcond_with py2
75f048d
%else
75f048d
%bcond_without py2
75f048d
%endif
75f048d
75f048d
# The test require internet to download data and so cannot be run in koji
bbdae64
# Confirmed all tests pass in mock with network access:
bbdae64
# mock -r fedora-rawhide-x86_64 rebuild ./python-mne-bids-0.1-2.fc29.src.rpm
bbdae64
# --enable-network --rpmbuild-opts="--with tests"
75f048d
# Test disable
75f048d
%bcond_with tests
75f048d
75f048d
%global pypi_name mne-bids
75f048d
75f048d
%global desc %{expand: \
75f048d
This is a repository for creating BIDS compatible data-sets with MNE.
75f048d
https://mne-tools.github.io/mne-bids/index.html}
75f048d
75f048d
Name:           python-%{pypi_name}
c1c10e1
Version:        0.2
84e9237
Release:        3%{?dist}
75f048d
Summary:        Experimental code for BIDS using MNE
75f048d
License:        BSD
75f048d
URL:            https://github.com/mne-tools/mne-bids
75f048d
Source0:        %{url}/archive/v%{version}/%{pypi_name}-%{version}.tar.gz
75f048d
BuildArch:      noarch
75f048d
75f048d
%{?python_enable_dependency_generator}
75f048d
75f048d
%description
75f048d
%{desc}
75f048d
75f048d
%if %{with py2}
75f048d
%package -n python2-%{pypi_name}
75f048d
Summary:        %{summary}
75f048d
75f048d
BuildRequires:  python2-devel
75f048d
BuildRequires:  python2-setuptools
bbdae64
BuildRequires:  python2-numpy
bbdae64
BuildRequires:  python2-pandas
bbdae64
BuildRequires:  python2-six
bbdae64
BuildRequires:  python2-scipy
bbdae64
BuildRequires:  python2-nose
bbdae64
BuildRequires:  python2-pytest-shutil
bbdae64
BuildRequires:  python2-matplotlib
bbdae64
BuildRequires:  python2-mne
75f048d
75f048d
Requires:  python2-mne
75f048d
Requires:  python2-numpy
75f048d
Requires:  python2-pandas
75f048d
Requires:  python2-six
75f048d
Requires:  python2-nose
75f048d
Requires:  python2-scipy
75f048d
Requires:  python2-pytest-shutil
75f048d
Requires:  python2-matplotlib
75f048d
75f048d
%{?python_provide:%python_provide python2-%{pypi_name}}
75f048d
75f048d
%description -n python2-%{pypi_name}
75f048d
%{desc}
75f048d
%endif
75f048d
75f048d
%package -n python3-%{pypi_name}
75f048d
Summary:        %{summary}
75f048d
75f048d
BuildRequires:  python3-devel
75f048d
BuildRequires:  python3-setuptools
75f048d
BuildRequires:  python3-numpy
75f048d
BuildRequires:  python3-pandas
75f048d
BuildRequires:  python3-six
bbdae64
BuildRequires:  python3-nose
75f048d
BuildRequires:  python3-scipy
bbdae64
BuildRequires:  python3-pytest-shutil
bbdae64
BuildRequires:  python3-matplotlib
bbdae64
BuildRequires:  python3-mne
75f048d
75f048d
Requires:  python3-mne
75f048d
Requires:  python3-numpy
75f048d
Requires:  python3-pandas
75f048d
Requires:  python3-six
75f048d
Requires:  python3-nose
75f048d
Requires:  python3-scipy
75f048d
Requires:  python3-pytest-shutil
75f048d
Requires:  python3-matplotlib
75f048d
75f048d
%{?python_provide:%python_provide python3-%{pypi_name}}
75f048d
75f048d
%description -n python3-%{pypi_name}
75f048d
%{desc}
75f048d
75f048d
%prep
75f048d
%autosetup -n %{pypi_name}-%{version}
75f048d
rm -rf %{pypi_name}.egg-info
75f048d
75f048d
sed -i 's/mne.externals.six/six/' mne_bids/utils.py
75f048d
75f048d
# remove she-bang lines in .py files.
75f048d
find * -type f -name "*.py" -exec sed -i '/^#![ ]*\/usr\/bin\/.*$/ d' {} 2>/dev/null ';'
75f048d
75f048d
%build
75f048d
%py3_build
75f048d
%if %{with py2}
75f048d
%py2_build
75f048d
%endif
75f048d
75f048d
%install
75f048d
%if %{with py2}
75f048d
%py2_install
75f048d
rm -rf %{buildroot}%{_bindir}/*
75f048d
%endif
75f048d
%py3_install
75f048d
75f048d
%check
75f048d
%if %{with tests}
75f048d
%if %{with py2}
75f048d
export PYTHONPATH=$RPM_BUILD_ROOT/%{python2_sitelib}
75f048d
pytest-%{python2_version} mne_bids
75f048d
%endif
75f048d
75f048d
export PYTHONPATH=$RPM_BUILD_ROOT/%{python3_sitelib}
75f048d
pytest-%{python3_version} mne_bids
75f048d
%endif
75f048d
75f048d
# Run test require internet
75f048d
# Example:
75f048d
# mock -r fedora-rawhide-x86_64 rebuild ./python-mne-bids-0.1-2.fc29.src.rpm --enable-network --rpmbuild-opts="--with tests"
75f048d
75f048d
%if %{with py2}
75f048d
%files -n python2-%{pypi_name}
75f048d
%license LICENSE
c1c10e1
%doc README.rst examples/README.txt
c1c10e1
%{_bindir}/mne_bids
7656bc8
%{python2_sitelib}/cli
75f048d
%{python2_sitelib}/mne_bids
75f048d
%{python2_sitelib}/mne_bids-%{version}-py?.?.egg-info
bbdae64
%endif
75f048d
75f048d
%files -n python3-%{pypi_name}
75f048d
%license LICENSE
c1c10e1
%doc README.rst examples/README.txt
75f048d
%{_bindir}/mne_bids
c1c10e1
%{python3_sitelib}/cli
75f048d
%{python3_sitelib}/mne_bids
75f048d
%{python3_sitelib}/mne_bids-%{version}-py?.?.egg-info
75f048d
75f048d
%changelog
84e9237
* Mon Aug 19 2019 Miro HronĨok <mhroncok@redhat.com> - 0.2-3
84e9237
- Rebuilt for Python 3.8
84e9237
7656bc8
* Mon Apr 29 2019 Luis Bazan <lbazan@fedoraproject.org> - 0.2-2
7656bc8
- Fix typo
7656bc8
c1c10e1
* Mon Apr 29 2019 Luis Bazan <lbazan@fedoraproject.org> - 0.2-1
c1c10e1
- New upstream version
c1c10e1
e186e03
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.1-3
e186e03
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
e186e03
75f048d
* Mon Nov 26 2018 Luis Bazan <lbazan@fedoraproject.org> - 0.1-2
75f048d
- Fix comment 1 in BZ 1652976
75f048d
75f048d
* Fri Nov 23 2018 Luis Bazan <lbazan@fedoraproject.org> - 0.1-1
75f048d
- New upstream