commit:     53c0ed9dd9a4aed4dbe15b5e64e0775a2bd87780
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 10 14:26:49 2024 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Mar 10 14:28:33 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=53c0ed9d

sci-libs/scikit-learn: Fix tests, QA

Deselect failing tests.  Clean up the test phase.  Use pytest-xdist
and disable plugin autoloading for a major speedup.

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 sci-libs/scikit-learn/scikit-learn-1.3.2-r1.ebuild | 27 ++++++++++++++++++----
 1 file changed, 22 insertions(+), 5 deletions(-)

diff --git a/sci-libs/scikit-learn/scikit-learn-1.3.2-r1.ebuild 
b/sci-libs/scikit-learn/scikit-learn-1.3.2-r1.ebuild
index 63eb9f3b7b75..6639b87b8580 100644
--- a/sci-libs/scikit-learn/scikit-learn-1.3.2-r1.ebuild
+++ b/sci-libs/scikit-learn/scikit-learn-1.3.2-r1.ebuild
@@ -10,8 +10,15 @@ PYTHON_COMPAT=( python3_{10..12} )
 inherit distutils-r1
 
 DESCRIPTION="Machine learning library for Python"
-HOMEPAGE="https://scikit-learn.org/stable/";
-SRC_URI="https://github.com/scikit-learn/scikit-learn/archive/${PV}.tar.gz -> 
${P}.gh.tar.gz"
+HOMEPAGE="
+       https://scikit-learn.org/stable/
+       https://github.com/scikit-learn/scikit-learn/
+       https://pypi.org/project/scikit-learn/
+"
+SRC_URI="
+       https://github.com/scikit-learn/scikit-learn/archive/${PV}.tar.gz
+               -> ${P}.gh.tar.gz
+"
 
 LICENSE="BSD"
 SLOT="0"
@@ -35,7 +42,9 @@ BDEPEND="
        dev-python/cython[${PYTHON_USEDEP}]
 "
 
+EPYTEST_XDIST=1
 distutils_enable_tests pytest
+
 # For some reason this wants to use urllib to fetch things from the internet
 # distutils_enable_sphinx doc \
 #      dev-python/matplotlib \
@@ -49,9 +58,17 @@ distutils_enable_tests pytest
 #      dev-python/scikit-image
 
 python_test() {
-       # This needs to be run in the install dir
-       cd 
"${WORKDIR}/${P}-${EPYTHON//./_}/install/usr/lib/${EPYTHON}/site-packages/sklearn"
 || die
-       distutils-r1_python_test
+       local EPYTEST_DESELECT=(
+               # test broken with newer scipy, fixed upstream
+               # https://github.com/scikit-learn/scikit-learn/issues/27578
+               manifold/tests/test_locally_linear.py::test_singular_matrix
+               # TODO
+               
gaussian_process/kernels.py::sklearn.gaussian_process.kernels.ExpSineSquared
+       )
+
+       rm -rf sklearn || die
+       local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
+       epytest --pyargs sklearn
 }
 
 python_install_all() {

Reply via email to