gnu: python-scikit-learn: Fix test failure.

* gnu/packages/python.scm (python-scikit-learn,
python2-scikit-learn)[arguments]: Use 'modify-phases'. Move 'check' phase
after 'install' and incorporate 'set-HOME' phase.
This commit is contained in:
Marius Bakke 2017-02-17 02:37:58 +01:00
parent 9200fe14f7
commit 4d25c486a5
No known key found for this signature in database
GPG Key ID: A2A06DF2A33A54FA
1 changed files with 14 additions and 5 deletions

View File

@ -3210,11 +3210,20 @@ and is very extensible.")
(build-system python-build-system)
(arguments
`(#:phases
(alist-cons-before
'check 'set-HOME
;; some tests require access to "$HOME"
(lambda _ (setenv "HOME" "/tmp"))
%standard-phases)))
(modify-phases %standard-phases
(delete 'check)
(add-after 'install 'check
;; Running tests from the source directory requires
;; an "inplace" build with paths relative to CWD.
;; http://scikit-learn.org/stable/developers/advanced_installation.html#testing
;; Use the installed version instead.
(lambda* (#:key inputs outputs #:allow-other-keys)
(add-installed-pythonpath inputs outputs)
;; some tests require access to "$HOME"
(setenv "HOME" "/tmp")
;; Step out of the source directory just to be sure.
(chdir "..")
(zero? (system* "nosetests" "-v" "sklearn")))))))
(inputs
`(("openblas" ,openblas)))
(native-inputs