Blob Blame History Raw
# using nose, which is deprecated, so we run this manually
%bcond_with tests

%global forgeurl  https://github.com/BlueBrain/eFEL
# Use github commit tar instead of pypi which does not include tests
%global commit 8e588642d61d11dead37fdd88be09d71ecb7a914

%global desc %{expand: \
The Electrophys Feature Extraction Library (eFEL) allows neuroscientists to
automatically extract features from time series data recorded from neurons
(both in vitro and in silico). Examples are the action potential width and
amplitude in voltage traces recorded during whole-cell patch clamp experiments.
The user of the library provides a set of traces and selects the features to be
calculated. The library will then extract the requested features and return the
values to the user.

The core of the library is written in C++, and a Python wrapper is included. At
the moment we provide a way to automatically compile and install the library as
a Python module.}

Name:           python-efel
Version:        4.0.4
Release:        %autorelease
Summary:        Electrophys Feature Extraction Library
%forgemeta

License:        LGPLv3
URL:            http://efel.readthedocs.io/
Source0:        %{forgesource}
# Use the _version.py from pypi
Source1:        _version.py

BuildRequires:  gcc-c++
BuildRequires:  python3-devel

%description
%{desc}

%package -n python3-efel
Summary:        %{summary}
BuildRequires:  python3-setuptools
%if %{with tests}
BuildRequires:  %{py3_dist scipy}
BuildRequires:  %{py3_dist neo}
BuildRequires:  %{py3_dist nose}
%endif

%description -n python3-efel
%{desc}

%prep
%forgesetup
rm -rf efel.egg-info

# Install the version file
cp %{SOURCE1} efel/_version.py -v

%generate_buildrequires
%pyproject_buildrequires -r

%build
%pyproject_wheel

%install
# Remove headers. We won't provide them here.
rm -rf %{buildroot}/%{python3_sitearch}/efel/cppcore/
%pyproject_install
%pyproject_save_files efel


%check
%pyproject_check_import
%if %{with tests}
# https://github.com/BlueBrain/eFEL/blob/master/Makefile#L36
pushd efel/tests
PYTHONPATH=%{buildroot}/%{python3_sitearch} nosetests-%{python3_version}  -s -v -x
popd
%endif

%files -n python3-efel -f %{pyproject_files}
%exclude %{python3_sitearch}/efel/cppcore/
%doc README.md

%changelog
%autochangelog