From 4130e588149a0eafe70da87966f54871e751d551 Mon Sep 17 00:00:00 2001 From: Benjamin A. Beasley Date: Aug 30 2022 14:44:50 +0000 Subject: Fix compatibility with scikit-learn 1.1.2 (fix RHBZ#2122144) Backport upstream PR#300. --- diff --git a/300.patch b/300.patch new file mode 100644 index 0000000..ab3e016 --- /dev/null +++ b/300.patch @@ -0,0 +1,53 @@ +From 09a7a65751d20cc4ba04e3725c47f59c9a13b619 Mon Sep 17 00:00:00 2001 +From: Raphael Vallat +Date: Mon, 29 Aug 2022 16:15:56 -0700 +Subject: [PATCH] sklearn >=1.1.2 + +--- + docs/changelog.rst | 5 +++++ + requirements.txt | 2 +- + setup.py | 2 +- + 3 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/docs/changelog.rst b/docs/changelog.rst +index 1569f5e..d77616b 100644 +--- a/docs/changelog.rst ++++ b/docs/changelog.rst +@@ -21,6 +21,11 @@ We have added the :py:func:`pingouin.ptests` function to calculate a T-test (T- + >>> df = pg.read_dataset('pairwise_corr').iloc[:30, 1:] + >>> df.ptests() + ++ ++**Dependencies** ++ ++a. New requirement for scikit-learn>=1.1.2, which includes bugfix for :py:func:`pingouin.logistic_regression`. `PR 272 `_. ++ + ************* + + v0.5.2 (June 2022) +diff --git a/requirements.txt b/requirements.txt +index 115ae3f..5e73cbb 100644 +--- a/requirements.txt ++++ b/requirements.txt +@@ -4,7 +4,7 @@ pandas>=1.0 + matplotlib>=3.0.2 + seaborn>=0.11 + statsmodels>=0.13 +-scikit-learn<1.1.0 ++scikit-learn>=1.1.2 + pandas_flavor>=0.2.0 + outdated + tabulate +diff --git a/setup.py b/setup.py +index 7009812..cf0c738 100644 +--- a/setup.py ++++ b/setup.py +@@ -28,7 +28,7 @@ def read(fname): + "matplotlib>=3.0.2", + "seaborn>=0.11", + "statsmodels>=0.13", +- "scikit-learn<1.1.0", ++ "scikit-learn>=1.1.2", + "pandas_flavor>=0.2.0", + "outdated", + "tabulate", diff --git a/pingouin-0.5.2-scikit-learn-1.1.2.patch b/pingouin-0.5.2-scikit-learn-1.1.2.patch new file mode 100644 index 0000000..ff2e1b0 --- /dev/null +++ b/pingouin-0.5.2-scikit-learn-1.1.2.patch @@ -0,0 +1,39 @@ +diff -Naur pingouin-0.5.2-original/docs/changelog.rst pingouin-0.5.2/docs/changelog.rst +--- pingouin-0.5.2-original/docs/changelog.rst 2022-06-24 13:41:06.000000000 -0400 ++++ pingouin-0.5.2/docs/changelog.rst 2022-08-30 10:37:33.649763612 -0400 +@@ -6,6 +6,11 @@ + .. contents:: Table of Contents + :depth: 2 + ++ ++**Dependencies** ++ ++a. New requirement for scikit-learn>=1.1.2, which includes bugfix for :py:func:`pingouin.logistic_regression`. `PR 272 `_. ++ + ************* + + v0.5.2 (June 2022) +diff -Naur pingouin-0.5.2-original/requirements.txt pingouin-0.5.2/requirements.txt +--- pingouin-0.5.2-original/requirements.txt 2022-06-24 13:41:06.000000000 -0400 ++++ pingouin-0.5.2/requirements.txt 2022-08-30 10:37:33.649763612 -0400 +@@ -4,7 +4,7 @@ + matplotlib>=3.0.2 + seaborn>=0.11 + statsmodels>=0.13 +-scikit-learn<1.1.0 ++scikit-learn>=1.1.2 + pandas_flavor>=0.2.0 + outdated + tabulate +diff -Naur pingouin-0.5.2-original/setup.py pingouin-0.5.2/setup.py +--- pingouin-0.5.2-original/setup.py 2022-06-24 13:41:06.000000000 -0400 ++++ pingouin-0.5.2/setup.py 2022-08-30 10:37:33.649763612 -0400 +@@ -28,7 +28,7 @@ + "matplotlib>=3.0.2", + "seaborn>=0.11", + "statsmodels>=0.13", +- "scikit-learn<1.1.0", ++ "scikit-learn>=1.1.2", + "pandas_flavor>=0.2.0", + "outdated", + "tabulate", diff --git a/python-pingouin.spec b/python-pingouin.spec index 83dc606..e5b9840 100644 --- a/python-pingouin.spec +++ b/python-pingouin.spec @@ -33,6 +33,12 @@ URL: https://pingouin-stats.org/ # PyPI tar does not contain docs and tests Source0: https://github.com/raphaelvallat/pingouin/archive/v%{version}/pingouin-%{version}.tar.gz +# Use scikit-learn>=1.1.2 +# https://github.com/raphaelvallat/pingouin/pull/300 +# +# Rebased on 0.5.2. +Patch: pingouin-0.5.2-scikit-learn-1.1.2.patch + BuildRequires: python3-devel # The odd combination of an arched package with only noarch binary packages @@ -61,7 +67,7 @@ BuildArch: noarch %{summary}. %prep -%autosetup -n pingouin-%{version} +%autosetup -n pingouin-%{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