gnu: python-scikit-learn: Run tests conditionally.

* gnu/packages/machine-learning.scm (python-scikit-learn)[arguments]: Respect
TESTS? in 'check phase.
This commit is contained in:
Ricardo Wurmus 2021-11-20 15:35:41 +01:00
parent 7ca5dc370d
commit 3d56b8af90
No known key found for this signature in database
GPG key ID: 197A5888235FACAC

View file

@ -944,14 +944,15 @@ (define-public python-scikit-learn
(add-after 'build 'build-ext (add-after 'build 'build-ext
(lambda _ (invoke "python" "setup.py" "build_ext" "--inplace"))) (lambda _ (invoke "python" "setup.py" "build_ext" "--inplace")))
(replace 'check (replace 'check
(lambda _ (lambda* (#:key tests? #:allow-other-keys)
;; Restrict OpenBLAS threads to prevent segfaults while testing! (when tests?
(setenv "OPENBLAS_NUM_THREADS" "1") ;; Restrict OpenBLAS threads to prevent segfaults while testing!
(setenv "OPENBLAS_NUM_THREADS" "1")
;; Some tests require write access to $HOME. ;; Some tests require write access to $HOME.
(setenv "HOME" "/tmp") (setenv "HOME" "/tmp")
(invoke "pytest" "sklearn" "-m" "not network"))) (invoke "pytest" "sklearn" "-m" "not network"))))
(add-before 'reset-gzip-timestamps 'make-files-writable (add-before 'reset-gzip-timestamps 'make-files-writable
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
;; Make sure .gz files are writable so that the ;; Make sure .gz files are writable so that the