Blob Blame History Raw
Name:           python-pyriemann
Version:        0.3
Release:        %autorelease
Summary:        Riemannian Geometry for Python

License:        BSD-3-Clause
Source0:        %{url}/archive/v%{version}/pyRiemann-%{version}.tar.gz

# This package has had architecture-dependent test failures in the past, e.g.
# “One test failure on s390x”
#, so we make the base
# package arched to ensure the tests run on all architectures. The binary
# packages are all still noarch, and there is no compiled code and therefore no
# debugging symbols.
%global debug_package %{nil}

#   Loosen tolerance in test_distance_func_separability
# Fixes:
#   One test failure on s390x
Patch:          %{url}/pull/193.patch

BuildRequires:  python3-devel

# Required to run tests
BuildRequires:  python3dist(pytest)

# Weak dependencies required for various tests
BuildRequires:  python3dist(seaborn)
BuildRequires:  python3dist(matplotlib)

%global common_description %{expand:
pyRiemann is a Python package for covariance matrices manipulation and
classification through Riemannian geometry.

The primary target is classification of multivariate biosignals, like EEG, MEG
or EMG.}

%description %{common_description}

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

BuildArch:      noarch

# Weak dependencies (not covered by extras other than “docs”/“tests”).
# See docs/installing.rst “Recommended dependencies”.
Recommends:     python3dist(matplotlib)
Recommends:     python3dist(mne)
Recommends:     python3dist(seaborn)

%description -n python3-pyriemann %{common_description}

%package doc
Summary:        Documentation and examples for pyRiemann

BuildArch:      noarch

# Sphinx-generated HTML documentation is not suitable for packaging; see
# for discussion.
# In general, we can generate PDF documentation as a substitute.
# Unfortunately, we can’t build *this* documentation without the MNE sample
# data ( The documentation build tries to download it
# from the network; we could perhaps circumvent this and include it as an
# additional source, but we must not do so because the sample data does not
# appear to be provided under a clearly-stated or acceptable license; see

%description doc %{common_description}

This package contains documentation and examples for pyRiemann.

%autosetup -n pyRiemann-%{version} -p1

# Remove copybutton.js script bundled from documentation via
# scikit-learn’s Sphinx theme. We will not be building HTML documentation
# anyway.
rm -vf doc/_static/copybutton.js
sed -r -i 's/^([[:blank:]]*)(.*copybutton\.js)/\1# \2/' doc/
# Remove bundled copy of; again, we
# are not going to use it.
rm -rvf doc/sphinxext/
sed -r -i 's/^([[:blank:]]*)(.*sphinx_issues.,)/\1# \2/' doc/
# Patch flake8 out of “tests” extra:
sed -r -i 's/("tests".*), "flake8"/\1/'

%pyproject_buildrequires -x tests


%pyproject_save_files pyriemann


%files -n python3-pyriemann -f %{pyproject_files}

%files doc
%license LICENSE
%doc examples