Blame python-mne-bids.spec

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 desc %{expand: \
b82338a
MNE-BIDS: Organizing MEG, EEG, and iEEG data according to the BIDS
b82338a
specification and facilitating their analysis with MNE-Python}
75f048d
b82338a
Name:           python-mne-bids
ca2eb34
Version:        0.12
ed6f51f
Release:        %autorelease
75f048d
Summary:        Experimental code for BIDS using MNE
ca2eb34
License:        BSD-3-Clause
75f048d
URL:            https://github.com/mne-tools/mne-bids
b82338a
Source0:        %{url}/archive/v%{version}/mne-bids-%{version}.tar.gz
75f048d
BuildArch:      noarch
ea52e92
ExcludeArch:    %{ix86}
75f048d
75f048d
%description
75f048d
%{desc}
75f048d
b82338a
%package -n python3-mne-bids
75f048d
Summary:        %{summary}
75f048d
75f048d
BuildRequires:  python3-devel
75f048d
BuildRequires:  python3-setuptools
b82338a
b82338a
# not automatically generated
75f048d
Requires:  python3-pandas
75f048d
Requires:  python3-six
75f048d
Requires:  python3-nose
75f048d
Requires:  python3-pytest-shutil
75f048d
Requires:  python3-matplotlib
c77a0a3
Requires:  python3-tempita
75f048d
b82338a
%description -n python3-mne-bids
75f048d
%{desc}
75f048d
75f048d
%prep
b82338a
%autosetup -n mne-bids-%{version}
75f048d
b82338a
# Not required on the python versions Fedora uses
b82338a
sed -i '/importlib-resources/ d' setup.cfg
75f048d
b82338a
sed -i 's/mne.externals.six/six/' mne_bids/utils.py
c77a0a3
find -type f -name '*.py' -exec sed -i \
c77a0a3
  -e "s/from mne.externals.tempita/from tempita/" \
c77a0a3
  {} ';'
c77a0a3
75f048d
# remove she-bang lines in .py files.
75f048d
find * -type f -name "*.py" -exec sed -i '/^#![ ]*\/usr\/bin\/.*$/ d' {} 2>/dev/null ';'
75f048d
b82338a
%generate_buildrequires
b82338a
%pyproject_buildrequires
b82338a
75f048d
%build
b82338a
%pyproject_wheel
75f048d
75f048d
%install
b82338a
%pyproject_install
b82338a
%pyproject_save_files mne_bids
75f048d
75f048d
%check
75f048d
%if %{with tests}
75f048d
export PYTHONPATH=$RPM_BUILD_ROOT/%{python3_sitelib}
b82338a
%{pytest} mne_bids -W ignore::DeprecationWarning
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
b82338a
%files -n python3-mne-bids -f %{pyproject_files}
7e0cace
%doc README.md examples/README.rst
75f048d
%{_bindir}/mne_bids
75f048d
75f048d
%changelog
ed6f51f
%autochangelog