c79af4e
# Use forge macros for pulling from GitHub
c79af4e
%global forgeurl https://github.com/alexandrebarachant/pyRiemann
c79af4e
2d93c42
Name:           python-pyriemann
c79af4e
Version:        0.5
1a4c782
Release:        %autorelease
2d93c42
Summary:        Riemannian Geometry for Python
c79af4e
%forgemeta
4f4298f
License:        BSD-3-Clause
c79af4e
URL:            %forgeurl
c79af4e
Source0:        %forgesource
c79af4e
# For fixing test failures
c79af4e
# https://github.com/pyRiemann/pyRiemann/issues/262
c79af4e
Patch:          https://patch-diff.githubusercontent.com/raw/pyRiemann/pyRiemann/pull/254.patch
76cc429
8b81b48
# This package has had architecture-dependent test failures in the past, e.g.
8b81b48
# “One test failure on s390x”
8b81b48
# https://github.com/pyRiemann/pyRiemann/issues/192, so we make the base
8b81b48
# package arched to ensure the tests run on all architectures. The binary
8b81b48
# packages are all still noarch, and there is no compiled code and therefore no
8b81b48
# debugging symbols.
8b81b48
%global debug_package %{nil}
76cc429
f508326
# Since F40, python-scikit-learn is ExcludeArch: %%{ix86}
f508326
ExcludeArch:    %{ix86}
f508326
2d93c42
BuildRequires:  python3-devel
2d93c42
2d93c42
# Required to run tests
2d93c42
BuildRequires:  python3dist(pytest)
2d93c42
2d93c42
# Weak dependencies required for various tests
2d93c42
BuildRequires:  python3dist(seaborn)
2d93c42
BuildRequires:  python3dist(matplotlib)
2d93c42
3271a0b
%global common_description %{expand:
2d93c42
pyRiemann is a Python package for covariance matrices manipulation and
2d93c42
classification through Riemannian geometry.
76cc429
2d93c42
The primary target is classification of multivariate biosignals, like EEG, MEG
2d93c42
or EMG.}
3271a0b
3271a0b
%description %{common_description}
76cc429
2d93c42
2d93c42
%package -n python3-pyriemann
76cc429
Summary:        %{summary}
0309109
8b81b48
BuildArch:      noarch
8b81b48
2d93c42
# Weak dependencies (not covered by extras other than “docs”/“tests”).
2d93c42
# See docs/installing.rst “Recommended dependencies”.
284c370
Recommends:     python3dist(matplotlib)
2d93c42
Recommends:     python3dist(mne)
2d93c42
Recommends:     python3dist(seaborn)
c796394
2d93c42
%description -n python3-pyriemann %{common_description}
76cc429
76cc429
770ec2b
%package doc
770ec2b
Summary:        Documentation and examples for pyRiemann
770ec2b
8b81b48
BuildArch:      noarch
8b81b48
8857f21
# Sphinx-generated HTML documentation is not suitable for packaging; see
8857f21
# https://bugzilla.redhat.com/show_bug.cgi?id=2006555 for discussion.
8857f21
#
8857f21
# In general, we can generate PDF documentation as a substitute.
8857f21
#
8857f21
# Unfortunately, we can’t build *this* documentation without the MNE sample
8857f21
# data (https://osf.io/86qa2). The documentation build tries to download it
8857f21
# from the network; we could perhaps circumvent this and include it as an
8857f21
# additional source, but we must not do so because the sample data does not
8857f21
# appear to be provided under a clearly-stated or acceptable license; see
8857f21
# https://predictablynoisy.com/mne-python/manual/sample_dataset.html.
8857f21
770ec2b
%description doc %{common_description}
770ec2b
770ec2b
This package contains documentation and examples for pyRiemann.
770ec2b
770ec2b
76cc429
%prep
2a92ab7
%autosetup -n pyRiemann-%{version} -p1
2d93c42
1640517
# Remove copybutton.js script bundled from python.org documentation via
1640517
# scikit-learn’s Sphinx theme. We will not be building HTML documentation
1640517
# anyway.
1640517
rm -vf doc/_static/copybutton.js
1640517
sed -r -i 's/^([[:blank:]]*)(.*copybutton\.js)/\1# \2/' doc/conf.py
284c370
# Remove bundled copy of https://pypi.org/pyroject/sphinx-issues/; again, we
284c370
# are not going to use it.
284c370
rm -rvf doc/sphinxext/
284c370
sed -r -i 's/^([[:blank:]]*)(.*sphinx_issues.,)/\1# \2/' doc/conf.py
284c370
# Patch flake8 out of “tests” extra:
284c370
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters
284c370
sed -r -i 's/("tests".*), "flake8"/\1/' setup.py
1640517
2d93c42
2d93c42
%generate_buildrequires
284c370
%pyproject_buildrequires -x tests
2d93c42
76cc429
76cc429
%build
2d93c42
%pyproject_wheel
2d93c42
76cc429
76cc429
%install
2d93c42
%pyproject_install
c3670ca
%pyproject_save_files -l pyriemann
2d93c42
76cc429
76cc429
%check
07fe768
%pytest ${k:+-k "$k"}
2d93c42
2d93c42
2d93c42
%files -n python3-pyriemann -f %{pyproject_files}
770ec2b
770ec2b
770ec2b
%files doc
770ec2b
%license LICENSE
2d93c42
%doc README.md
2d93c42
%doc examples
76cc429
76cc429
76cc429
%changelog
1a4c782
%autochangelog