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.
This commit is contained in:
Ricardo Wurmus 2018-09-20 15:53:20 +02:00 committed by Ricardo Wurmus
parent 26358ac5ab
commit 391fc11f0e
No known key found for this signature in database
GPG Key ID: 197A5888235FACAC
1 changed files with 18 additions and 1 deletions

View File

@ -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")