summary refs log tree commit diff
path: root/gnu/packages
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2021-10-08 22:34:32 -0400
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2021-10-09 23:49:08 -0400
commitf98306ad287a22342453209a8b842f4172e95497 (patch)
treeef6999c382bb153276161d0704a3925e427331a5 /gnu/packages
parentb33dc57d3e37ceebd347a35435ef663537b15a8c (diff)
downloadguix-f98306ad287a22342453209a8b842f4172e95497.tar.gz
gnu: python-keras: Enable parallel tests.
* (python-keras)[phases]: Delete trailing #t.
{check}: Honor TESTS?.  Run the tests in parallel.  Disable PEP8 lint.
Diffstat (limited to 'gnu/packages')
-rw-r--r--gnu/packages/machine-learning.scm33
1 files changed, 17 insertions, 16 deletions
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 9a8d1d5e7d..a2b5283900 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -2544,24 +2544,26 @@ with image data, text data, and sequence data.")
              (delete-file "keras/backend/theano_backend.py")
              (delete-file "keras/backend/cntk_backend.py")
              (delete-file "tests/keras/backend/backend_test.py")
-
              ;; FIXME: This doesn't work because Tensorflow is missing the
              ;; coder ops library.
-             (delete-file "tests/keras/test_callbacks.py")
-             #t))
+             (delete-file "tests/keras/test_callbacks.py")))
          (replace 'check
-           (lambda _
-             ;; These tests attempt to download data files from the internet.
-             (delete-file "tests/integration_tests/test_datasets.py")
-             (delete-file "tests/integration_tests/imagenet_utils_test.py")
-             ;; Backport https://github.com/keras-team/keras/pull/12479.
-             (substitute* "tests/keras/engine/test_topology.py"
-               (("np.ones\\(\\(3, 2\\)\\)")
-                "1."))
-             (invoke "python" "-m" "pytest"
-                     ;; The following test fail only in the build container;
-                     ;; skip it.
-                     "-k" "not test_selu"))))))
+           (lambda* (#:key tests? #:allow-other-keys)
+             (when tests?
+               ;; These tests attempt to download data files from the internet.
+               (delete-file "tests/integration_tests/test_datasets.py")
+               (delete-file "tests/integration_tests/imagenet_utils_test.py")
+               ;; Backport https://github.com/keras-team/keras/pull/12479.
+               (substitute* "tests/keras/engine/test_topology.py"
+                 (("np.ones\\(\\(3, 2\\)\\)")
+                  "1."))
+               (invoke "python" "-m" "pytest" "tests"
+                       "-p" "no:pep8"
+                       ;; FIXME: python-build-system lacks PARALLEL-TESTS?
+                       "-n" (number->string (parallel-job-count))
+                       ;; The following test fail only in the build container;
+                       ;; skip it.
+                       "-k" "not test_selu")))))))
     (propagated-inputs
      `(("python-h5py" ,python-h5py)
        ("python-keras-applications" ,python-keras-applications)
@@ -2588,7 +2590,6 @@ with image data, text data, and sequence data.")
 and capable of running on top of TensorFlow.  It was developed with a focus on
 enabling fast experimentation.  Use Keras if you need a deep learning library
 that:
-
 @itemize
 @item Allows for easy and fast prototyping (through user friendliness,
   modularity, and extensibility).