summary refs log tree commit diff
path: root/gnu/packages
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2024-01-24 11:26:05 +0100
committerRicardo Wurmus <rekado@elephly.net>2024-01-24 11:34:35 +0100
commit6a22f65d661d65491bab2fc45da8ed6d6414f5ff (patch)
treecaf422dde4a42f26b13f8d20a32e6db99bff0ed7 /gnu/packages
parent90f9528748db5edc8df20dc4c625fd6ad1a55b8f (diff)
downloadguix-6a22f65d661d65491bab2fc45da8ed6d6414f5ff.tar.gz
gnu: python-scikit-learn-extra: Update to 0.3.0-1.0f95d8d.
* gnu/packages/machine-learning.scm (python-scikit-learn-extra): Update to
0.3.0-1.0f95d8d.
[arguments]: Move test flags out of 'check phase and to #:test-flags.
[propagated-inputs]: Add python-packaging.

Change-Id: I4081a9364a0646d0c6960a3d155315e8eff8af59
Diffstat (limited to 'gnu/packages')
-rw-r--r--gnu/packages/machine-learning.scm95
1 files changed, 52 insertions, 43 deletions
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 7c27fda9bd..5748275242 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -1673,52 +1673,61 @@ data analysis.")
     (license license:bsd-3)))
 
 (define-public python-scikit-learn-extra
-  (package
-    (name "python-scikit-learn-extra")
-    (version "0.3.0")
-    (source
-     (origin
-       (method git-fetch)
-       (uri (git-reference
-             (url "https://github.com/scikit-learn-contrib/scikit-learn-extra")
-             (commit (string-append "v" version))))
-       (file-name (git-file-name name version))
-       (sha256
-        (base32 "0yy6ka94ss88f3r7b6mpjf1l8lnv7aabhsg844pigfj8lfiv0wvl"))))
-    (build-system pyproject-build-system)
-    (arguments
-     (list #:phases
-           #~(modify-phases %standard-phases
-               (add-after 'build 'build-ext
-                 (lambda _
-                   (invoke "python" "setup.py" "build_ext"
-                           "--inplace")))
-               (replace 'check
-                 (lambda* (#:key tests? #:allow-other-keys)
-                   (when tests?
-                     ;; Restrict OpenBLAS threads to prevent segfaults while testing!
-                     (setenv "OPENBLAS_NUM_THREADS" "1")
-
-                     ;; Some tests require write access to $HOME.
-                     (setenv "HOME" "/tmp")
-
-                     ;; Step out of the source directory to avoid interference;
-                     ;; we want to run the installed code with extensions etc.
-                     (with-directory-excursion "/tmp"
-                       (invoke "pytest" "-vv" "--pyargs"
-                               "sklearn_extra"
-                               ;; ignore tests that require network
-                               "-k" "not test_build"))))))))
-    (propagated-inputs (list python-numpy python-scikit-learn python-scipy))
-    (native-inputs (list python-pytest python-pytest-cov python-cython))
-    (home-page "https://github.com/scikit-learn-contrib/scikit-learn-extra")
-    (synopsis "Set of tools for scikit-learn")
-    (description
-     "This package provides a Python module for machine learning that extends
+  ;; This commit fixes an incompatibility with newer versions of scikit-learn
+  (let ((commit "0f95d8dda4c69f9de4fb002366041adcb1302f3b")
+        (revision "1"))
+    (package
+      (name "python-scikit-learn-extra")
+      (version (git-version "0.3.0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/scikit-learn-contrib/scikit-learn-extra")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "0a248sff1psfwzmngj465gzyisq20d83nzpwpq2cspxhih51m6j9"))))
+      (build-system pyproject-build-system)
+      (arguments
+       (list
+        #:test-flags
+        ;; ignore tests that require network
+        '(list "--pyargs" "sklearn_extra"
+               "-k" "not test_build")
+        #:phases
+             #~(modify-phases %standard-phases
+                 (add-after 'build 'build-ext
+                   (lambda _
+                     (invoke "python" "setup.py" "build_ext"
+                             "--inplace")))
+                 (replace 'check
+                   (lambda* (#:key tests? test-flags #:allow-other-keys)
+                     (when tests?
+                       ;; Restrict OpenBLAS threads to prevent segfaults while testing!
+                       (setenv "OPENBLAS_NUM_THREADS" "1")
+
+                       ;; Some tests require write access to $HOME.
+                       (setenv "HOME" "/tmp")
+
+                       ;; Step out of the source directory to avoid interference;
+                       ;; we want to run the installed code with extensions etc.
+                       (with-directory-excursion "/tmp"
+                         (apply invoke "pytest" "-vv" test-flags))))))))
+      (propagated-inputs
+       (list python-numpy
+             python-scikit-learn
+             python-scipy
+             python-packaging))
+      (native-inputs (list python-pytest python-pytest-cov python-cython))
+      (home-page "https://github.com/scikit-learn-contrib/scikit-learn-extra")
+      (synopsis "Set of tools for scikit-learn")
+      (description
+       "This package provides a Python module for machine learning that extends
 scikit-learn.  It includes algorithms that are useful but do not satisfy the
 scikit-learn inclusion criteria, for instance due to their novelty or lower
 citation number.")
-    (license license:bsd-3)))
+      (license license:bsd-3))))
 
 (define-public python-thinc
   (package