mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
gnu: python-scikit-learn: Parallelize build and test suite.
* gnu/packages/machine-learning.scm (python-scikit-learn) [phases]{configure}: New phase. {build-ext}: Add '-j' option. {check}: Add '-n' option. [native-inputs]: Add python-pytest-xdist.
This commit is contained in:
parent
c359a4fabb
commit
1d1f44b709
1 changed files with 13 additions and 6 deletions
|
@ -16,7 +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, 2021, 2022 Vinicius Monego <monego@posteo.net>
|
;;; Copyright © 2020, 2021, 2022 Vinicius Monego <monego@posteo.net>
|
||||||
;;; Copyright © 2020, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
|
;;; Copyright © 2020, 2021, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
;;;
|
;;;
|
||||||
|
@ -1095,8 +1095,13 @@ (define-public python-scikit-learn
|
||||||
(arguments
|
(arguments
|
||||||
`(#:phases
|
`(#:phases
|
||||||
(modify-phases %standard-phases
|
(modify-phases %standard-phases
|
||||||
|
(add-before 'build 'configure
|
||||||
|
(lambda _
|
||||||
|
(setenv "SKLEARN_BUILD_PARALLEL"
|
||||||
|
(number->string (parallel-job-count)))))
|
||||||
(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"
|
||||||
|
"-j" (number->string (parallel-job-count)))))
|
||||||
(replace 'check
|
(replace 'check
|
||||||
(lambda* (#:key tests? #:allow-other-keys)
|
(lambda* (#:key tests? #:allow-other-keys)
|
||||||
(when tests?
|
(when tests?
|
||||||
|
@ -1107,13 +1112,15 @@ (define-public python-scikit-learn
|
||||||
(setenv "HOME" "/tmp")
|
(setenv "HOME" "/tmp")
|
||||||
|
|
||||||
(invoke "pytest" "sklearn" "-m" "not network"
|
(invoke "pytest" "sklearn" "-m" "not network"
|
||||||
|
"-n" (number->string (parallel-job-count))
|
||||||
;; This test tries to access the internet.
|
;; This test tries to access the internet.
|
||||||
"-k" "not test_load_boston_alternative")))))))
|
"-k" "not test_load_boston_alternative")))))))
|
||||||
(inputs
|
(inputs (list openblas))
|
||||||
(list openblas))
|
|
||||||
(native-inputs
|
(native-inputs
|
||||||
(list python-pytest python-pandas ;for tests
|
(list python-cython
|
||||||
python-cython))
|
python-pandas
|
||||||
|
python-pytest
|
||||||
|
python-pytest-xdist))
|
||||||
(propagated-inputs
|
(propagated-inputs
|
||||||
(list python-numpy python-threadpoolctl python-scipy python-joblib))
|
(list python-numpy python-threadpoolctl python-scipy python-joblib))
|
||||||
(home-page "https://scikit-learn.org/")
|
(home-page "https://scikit-learn.org/")
|
||||||
|
|
Loading…
Reference in a new issue