guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

03/04: gnu: python-scikit-learn: Run tests conditionally.


From: guix-commits
Subject: 03/04: gnu: python-scikit-learn: Run tests conditionally.
Date: Sat, 20 Nov 2021 10:23:30 -0500 (EST)

rekado pushed a commit to branch core-updates-frozen
in repository guix.

commit 3d56b8af9046c056e68955ce4d929f18d796e33a
Author: Ricardo Wurmus <rekado@elephly.net>
AuthorDate: Sat Nov 20 15:35:41 2021 +0100

    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(-)

diff --git a/gnu/packages/machine-learning.scm 
b/gnu/packages/machine-learning.scm
index 4e18cf0..d51bf63 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]