From 3d56b8af9046c056e68955ce4d929f18d796e33a Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sat, 20 Nov 2021 15:35:41 +0100 Subject: gnu: python-scikit-learn: Run tests conditionally. * gnu/packages/machine-learning.scm (python-scikit-learn)[arguments]: Respect TESTS? in 'check phase. --- gnu/packages/machine-learning.scm | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'gnu/packages') diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index 4e18cf0517..d51bf63473 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -944,14 +944,15 @@ computing environments.") (add-after 'build 'build-ext (lambda _ (invoke "python" "setup.py" "build_ext" "--inplace"))) (replace 'check - (lambda _ - ;; Restrict OpenBLAS threads to prevent segfaults while testing! - (setenv "OPENBLAS_NUM_THREADS" "1") + (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") + ;; Some tests require write access to $HOME. + (setenv "HOME" "/tmp") - (invoke "pytest" "sklearn" "-m" "not network"))) + (invoke "pytest" "sklearn" "-m" "not network")))) (add-before 'reset-gzip-timestamps 'make-files-writable (lambda* (#:key outputs #:allow-other-keys) ;; Make sure .gz files are writable so that the -- cgit v1.2.3