Archived
1
0
Fork 0

gnu: python-scikit-learn: Update to 1.3.2.

* gnu/packages/machine-learning.scm (python-scikit-learn): Update to 1.3.2.
[build-system]: Use pyproject-build-system.
[arguments]: Move test flags to #:test-flags.
[native-inputs]: Replace python-cython with python-cython-0.29.35.

Change-Id: Iac6107dae752c42d9f57448a66eed0526974d57e
This commit is contained in:
Ricardo Wurmus 2024-01-08 13:19:26 +01:00
parent e759380796
commit 247c427302
No known key found for this signature in database
GPG key ID: 197A5888235FACAC

View file

@ -1613,7 +1613,7 @@ computing environments.")
(define-public python-scikit-learn (define-public python-scikit-learn
(package (package
(name "python-scikit-learn") (name "python-scikit-learn")
(version "1.2.2") (version "1.3.2")
(source (source
(origin (origin
(method git-fetch) (method git-fetch)
@ -1623,20 +1623,25 @@ computing environments.")
(file-name (git-file-name name version)) (file-name (git-file-name name version))
(sha256 (sha256
(base32 (base32
"0x7gfzvcdadf8jnvpz8m373bi37bc6sndfbjh9lzmn3p39pwm2hl")))) "1hr024vcilbjwlwn32ppadri0ypnzjmkfxhkkw8gih0qjvcvjbs7"))))
(build-system python-build-system) (build-system pyproject-build-system)
(arguments (arguments
`(#:phases (list
(modify-phases %standard-phases #:test-flags
'(list "-m" "not network"
;; This test tries to access the internet.
"-k" "not test_load_boston_alternative")
#:phases
'(modify-phases %standard-phases
(add-before 'build 'configure (add-before 'build 'configure
(lambda _ (lambda _
(setenv "SKLEARN_BUILD_PARALLEL" (setenv "SKLEARN_BUILD_PARALLEL"
(number->string (parallel-job-count))))) (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))))) "-j" (number->string (parallel-job-count)))))
(replace 'check (replace 'check
(lambda* (#:key tests? #:allow-other-keys) (lambda* (#:key tests? test-flags #:allow-other-keys)
(when tests? (when tests?
;; Restrict OpenBLAS threads to prevent segfaults while testing! ;; Restrict OpenBLAS threads to prevent segfaults while testing!
(setenv "OPENBLAS_NUM_THREADS" "1") (setenv "OPENBLAS_NUM_THREADS" "1")
@ -1647,14 +1652,11 @@ computing environments.")
;; Step out of the source directory to avoid interference; ;; Step out of the source directory to avoid interference;
;; we want to run the installed code with extensions etc. ;; we want to run the installed code with extensions etc.
(with-directory-excursion "/tmp" (with-directory-excursion "/tmp"
(invoke "pytest" "-vv" "--pyargs" "sklearn" (apply invoke "pytest" "--pyargs" "sklearn"
"-m" "not network" test-flags))))))))
"-n" (number->string (parallel-job-count))
;; This test tries to access the internet.
"-k" "not test_load_boston_alternative"))))))))
(inputs (list openblas)) (inputs (list openblas))
(native-inputs (native-inputs
(list python-cython (list python-cython-0.29.35
python-pandas python-pandas
python-pytest python-pytest
python-pytest-xdist)) python-pytest-xdist))