summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorRicardo Wurmus <ricardo.wurmus@mdc-berlin.de>2018-09-20 15:53:20 +0200
committerRicardo Wurmus <rekado@elephly.net>2018-09-20 15:56:59 +0200
commit391fc11f0e492b06fa6eb31535e1e34165040b7d (patch)
tree0f585eb3239a80a353fcc841eb345f2ee7f96a9d /gnu
parent26358ac5ab612e3ba5cc965994853f4a6616220c (diff)
downloadguix-391fc11f0e492b06fa6eb31535e1e34165040b7d.tar.gz
gnu: python2-scikit-learn: Fix check phase.
* gnu/packages/machine-learning.scm (python2-scikit-learn)[arguments]:
Override check phase to disable broken tests and pass environment variables.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/machine-learning.scm19
1 files changed, 18 insertions, 1 deletions
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 9aa61bd8f8..990a6c771a 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -750,7 +750,24 @@ data analysis.")
     (license license:bsd-3)))
 
 (define-public python2-scikit-learn
-  (package-with-python2 python-scikit-learn))
+  (let ((parent (package-with-python2 python-scikit-learn)))
+    (package (inherit parent)
+      (arguments
+       (substitute-keyword-arguments (package-arguments parent)
+         ((#:phases phases)
+          `(modify-phases ,phases
+             (replace 'check
+               (lambda _
+                 ;; Restrict OpenBLAS threads to prevent segfaults while testing!
+                 (setenv "OPENBLAS_NUM_THREADS" "1")
+                 ;; Some tests expect to be able to write to HOME.
+                 (setenv "HOME" "/tmp")
+                 ;; Disable tests that require network access
+                 (delete-file "sklearn/datasets/tests/test_kddcup99.py")
+                 (delete-file "sklearn/datasets/tests/test_mldata.py")
+                 (delete-file "sklearn/datasets/tests/test_rcv1.py")
+                 (invoke "pytest" "sklearn")
+                 #t)))))))))
 
 (define-public python-autograd
   (let* ((commit "442205dfefe407beffb33550846434baa90c4de7")