gnu: python-keras: Fix build.

Fixes <https://issues.guix.gnu.org/39562>.

* gnu/packages/machine-learning.scm (python-keras)[phases]{check}: Apply
upstream fix to test_topology.py.  Skip the failing test_selu test.

Reported-by: Pierre Neidhardt <mail@ambrevar.xyz>
This commit is contained in:
Maxim Cournoyer 2020-10-05 01:31:07 -04:00
parent 0450499930
commit 5f37d7e38e
No known key found for this signature in database
GPG key ID: 1260E46482E63562

View file

@ -16,6 +16,7 @@
;;; Copyright © 2020 Konrad Hinsen <konrad.hinsen@fastmail.net> ;;; Copyright © 2020 Konrad Hinsen <konrad.hinsen@fastmail.net>
;;; Copyright © 2020 Edouard Klein <edk@beaver-labs.com> ;;; Copyright © 2020 Edouard Klein <edk@beaver-labs.com>
;;; Copyright © 2020 Vinicius Monego <monego@posteo.net> ;;; Copyright © 2020 Vinicius Monego <monego@posteo.net>
;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -1930,13 +1931,14 @@ (define-public python-keras
;; These tests attempt to download data files from the internet. ;; These tests attempt to download data files from the internet.
(delete-file "tests/integration_tests/test_datasets.py") (delete-file "tests/integration_tests/test_datasets.py")
(delete-file "tests/integration_tests/imagenet_utils_test.py") (delete-file "tests/integration_tests/imagenet_utils_test.py")
;; Backport https://github.com/keras-team/keras/pull/12479.
(setenv "PYTHONPATH" (substitute* "tests/keras/engine/test_topology.py"
(string-append (getcwd) "/build/lib:" (("np.ones\\(\\(3, 2\\)\\)")
(getenv "PYTHONPATH"))) "1."))
(invoke "py.test" "-v" (invoke "python" "-m" "pytest"
"-p" "no:cacheprovider" ;; The following test fail only in the build container;
"--ignore" "keras/utils")))))) ;; skip it.
"-k" "not test_selu"))))))
(propagated-inputs (propagated-inputs
`(("python-h5py" ,python-h5py) `(("python-h5py" ,python-h5py)
("python-keras-applications" ,python-keras-applications) ("python-keras-applications" ,python-keras-applications)