Blob Blame History Raw
%bcond_without tests
%bcond_with docs

%global srcname pingouin

%global _description %{expand:
Pingouin is an open-source statistical package written in Python 3 and based on
Pandas and NumPy.

It provides easy-to-grasp functions for computing several statistical
functions:

- ANOVAs: one- and two-ways, repeated measures, mixed, ancova
- Post-hocs tests and pairwise comparisons
- Robust correlations
- Partial correlation, repeated measures correlation and intraclass correlation
- Bayes Factor
- Tests for sphericity, normality and homoscedasticity
- Effect sizes (Cohen's d, Hedges'g, AUC, Glass delta, eta-square...)
- Parametric/bootstrapped confidence intervals around an effect size or a
  correlation coefficient
- Circular statistics
- Linear/logistic regression and mediation analysis

Pingouin is designed for users who want simple yet exhaustive statistical
functions.}

Name:           python-%{srcname}
Version:        0.5.0
Release:        1%{?dist}
Summary:        Statistical package in Python based on Pandas

# Documentation pulls in bootstrap, bootswatch, jquery which are MIT
License:        GPLv3 and MIT
URL:            https://pingouin-stats.org/
# PyPI tar does not contain docs and tests
Source0:        https://github.com/raphaelvallat/%{srcname}/archive/v%{version}/%{srcname}-%{version}.tar.gz

# TestCorrelation::test_corr fails on aarch64, ppc64le, and s390x without this
# patch.
# https://github.com/raphaelvallat/pingouin/issues/195
Patch0:         0001-Loosen-one-test-to-allow-near-unity-correlation.patch

BuildRequires:  python3-devel

# The odd combination of an arched package with only noarch binary packages
# makes it easier for us to detect with arch-dependent test failures, since the
# tests will always be run on every platform, and easier for us to skip failing
# tests if necessary, since we can be sure that %%ifarch macros work as
# expected.
#
# Since the package still contains no compiled machine code, we still have no
# debuginfo.
%global debug_package %{nil}

%description %_description

%package -n python3-%{srcname}
Summary:        %{summary}
BuildArch:      noarch

%description -n python3-%{srcname} %_description

%package doc
Summary:        Documentation and examples for %{name}
BuildArch:      noarch

%if %{with docs}
BuildRequires:  make
BuildRequires:  %{py3_dist sphinx}
# docs/conf.py
BuildRequires:  %{py3_dist sphinx-bootstrap-theme}
BuildRequires:  %{py3_dist sphinx-copybutton}
BuildRequires:  %{py3_dist numpydoc}
%endif

%description doc
%{summary}.

%prep
%autosetup -n %{srcname}-%{version} -p1
%if %{with tests}
# Only required and works in TRAVIS, so not needed here
sed -r -i 's/^(pytest-travis-fold)$/# \1/' requirements-test.txt
%endif

%generate_buildrequires
%pyproject_buildrequires -r %{?with_tests:requirements-test.txt}

%build
%pyproject_wheel

%if %{with docs}
PYTHONPATH="${PWD}" %make_build -C docs html SPHINXOPTS='%{_smp_mflags}'
find docs/build/html -maxdepth 1 -name '.*' -execdir rm -rvf '{}' '+'
%endif

%install
%pyproject_install
%pyproject_save_files %{srcname}

%check
%if %{with tests}
%ifarch %{arm32}
# https://github.com/raphaelvallat/pingouin/issues/196
k="${k-}${k+ and }not (TestRegression and test_linear_regression)"
%endif
%ifarch %{arm32} %{ix86}
# https://github.com/raphaelvallat/pingouin/issues/197
# https://github.com/pandas-dev/pandas/issues/43588
k="${k-}${k+ and }not (TestParametric and test_pandas)"
%endif
%pytest -k "${k-}"
%endif

%files -n python3-%{srcname} -f %{pyproject_files}
%doc CODE_OF_CONDUCT.md
%doc README.rst

%files doc
%license LICENSE
%doc notebooks
%if %{with docs}
%doc html
%endif

%changelog
* Fri Oct 29 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 0.5.0-1
- Update to 0.5.0 (close RHBZ#2018342)

* Thu Sep 23 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 0.4.0-1
- Update to 0.4.0
- Switch to pyproject-rpm-macros to avoid manual BR’s
- Use an arched source package with only noarch binary packages to ensure tests
  are run on all arches; while this package really is noarch, it has a history
  of arch-dependent test failures

* Fri Jul 23 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 0.3.12-3
- Fix RHBZ#1981679

* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.12-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

* Thu Jun 17 2021 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.3.12-1
- Update to new release

* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 0.3.11-2
- Rebuilt for Python 3.10

* Sat May 22 2021 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.3.11-1
- Update to latest release

* Sun Mar 28 2021 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.3.10-1
- Update to new release

* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.8-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

* Sun Sep 13 2020 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.3.8-1
- Update to new release
- Fix BR on scipy

* Fri Sep 04 2020 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.3.7-1
- Update to new release

* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

* Sat Jul 04 2020 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.3.6-1
- Update to new release

* Thu Jun 25 2020 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.3.5-2
- Explicitly BR setuptools

* Sun Jun 21 2020 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.3.5-1
- Update to 0.3.5

* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 0.3.3-2
- Rebuilt for Python 3.9

* Sat May 02 2020 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.3.3-1
- Update to latest release

* Fri Dec 06 2019 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.3.1-1
- Update to 0.3.1

* Sat Nov 09 2019 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.2.9-1
- Update to 0.2.9
- rebuild since scipy 1.3.0 is now available in rawhide
- Requires pandas-flavor, needs packaging

* Sat Jul 20 2019 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.2.7-1
- Correct license
- Add missing BR
- Add notebooks to documentation

* Fri Jul 19 2019 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.2.7-1
- Initial build