Blob Blame History Raw
%bcond_without tests

Name:           python-ephyviewer
Version:        1.5.1
Release:        %autorelease
Summary:        Simple viewers for ephys signals, events, video and more

License:        MIT
Source0:        %{url}/archive/%{version}/%{name}-%{version}.tar.gz

BuildArch:      noarch
BuildRequires:  python3-devel
BuildRequires:  python3-pytest

# python-pyedflib does not support s390x$
ExcludeArch:    s390x

%global _description %{expand:
ephyviewer is a Python library based on pyqtgraph for building custom viewers
for electrophysiological signals, video, events, epochs, spike trains, data
tables, and time-frequency representations of signals. It also provides an
epoch encoder for creating annotations.

Documentation is available at}

%description %_description

%package -n python3-ephyviewer
Summary:        %{summary}
# needs Xvfb
BuildRequires:  xorg-x11-server-Xvfb

%description -n python3-ephyviewer %_description

%autosetup -n ephyviewer-%{version}

# spikeinterface and av optional and not yet packaged
# av: bindings for ffmpeg so we'll need to see if it can be included in Fedora
# remove pytest-cov
sed -i -e '/spikeinterface/ d' -e '/av/ d' -e '/pytest-cov/ d' requirements-tests.txt

%pyproject_buildrequires -r -x tests


%pyproject_save_files ephyviewer

%if %{with tests}

# some tests segfault with xvfb, so we disable these
# other tests that require unpackaged extra modules or download data
xvfb-run -a -s "-screen 0 1920x1200x24 -ac +extension GLX" pytest-3 \
    -k "not test_spiketrainviewer and not test_timefreqviewer and not test_traceviewer and not test_VideoMultiFileSource and not test_spikeinterface_sources and not test_spikeinterface_viewer and not test_videoviewer and not test_neo_rawio_sources and not test_mainviewer2 and not test_neoviewer"

%files -n python3-ephyviewer -f %{pyproject_files}
%doc README.*