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

* gnu/packages/machine-learning.scm (python-scikit-learn): Update to 0.19.2.
[source]: Fetch from git.
[arguments]: Run tests before installation; replace "check" phase, add
"build-ext" phase; delete "reset-gzip-timestamps" phase.
[native-inputs]: Add python-pytest and python-pandas; remove python-nose.
This commit is contained in:
Ricardo Wurmus 2018-09-12 19:04:02 +02:00 committed by Ricardo Wurmus
parent b002809f84
commit 4a89bdd196
No known key found for this signature in database
GPG Key ID: 197A5888235FACAC
1 changed files with 25 additions and 24 deletions

View File

@ -703,40 +703,41 @@ computing environments.")
(define-public python-scikit-learn (define-public python-scikit-learn
(package (package
(name "python-scikit-learn") (name "python-scikit-learn")
(version "0.19.1") (version "0.19.2")
(source (source
(origin (origin
(method url-fetch) (method git-fetch)
(uri (string-append (uri (git-reference
"https://github.com/scikit-learn/scikit-learn/archive/" (url "https://github.com/scikit-learn/scikit-learn.git")
version ".tar.gz")) (commit version)))
(file-name (string-append name "-" version ".tar.gz")) (file-name (git-file-name name version))
(sha256 (sha256
(base32 (base32
"18n8775kyfwbvcjjjzda9c5sqy4737c0hrmj6qj1ps2jmlqzair9")) "1dk9hdj01c0bny4ps78b7869fjw9gr6qklxf6wyql8h6nh4k19xm"))
(patches (search-patches (patches (search-patches
"python-scikit-learn-fix-test-non-determinism.patch")))) "python-scikit-learn-fix-test-non-determinism.patch"))))
(build-system python-build-system) (build-system python-build-system)
(arguments (arguments
`(#:phases `(#:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(delete 'check) (add-after 'build 'build-ext
(add-after 'install 'check (lambda _ (invoke "python" "setup.py" "build_ext" "--inplace") #t))
;; Running tests from the source directory requires (replace 'check
;; an "inplace" build with paths relative to CWD. (lambda _
;; http://scikit-learn.org/stable/developers/advanced_installation.html#testing ;; Restrict OpenBLAS threads to prevent segfaults while testing!
;; Use the installed version instead. (setenv "OPENBLAS_NUM_THREADS" "1")
(lambda* (#:key inputs outputs #:allow-other-keys) ;; Disable tests that require network access
(add-installed-pythonpath inputs outputs) (delete-file "sklearn/datasets/tests/test_mldata.py")
;; some tests require access to "$HOME" (delete-file "sklearn/datasets/tests/test_rcv1.py")
(setenv "HOME" "/tmp") (invoke "pytest" "sklearn")
;; Step out of the source directory just to be sure. #t))
(chdir "..") ;; FIXME: This fails with permission denied
(invoke "nosetests" "-v" "sklearn")))))) (delete 'reset-gzip-timestamps))))
(inputs (inputs
`(("openblas" ,openblas))) `(("openblas" ,openblas)))
(native-inputs (native-inputs
`(("python-nose" ,python-nose) `(("python-pytest" ,python-pytest)
("python-pandas" ,python-pandas) ;for tests
("python-cython" ,python-cython))) ("python-cython" ,python-cython)))
(propagated-inputs (propagated-inputs
`(("python-numpy" ,python-numpy) `(("python-numpy" ,python-numpy)
@ -744,8 +745,8 @@ computing environments.")
(home-page "http://scikit-learn.org/") (home-page "http://scikit-learn.org/")
(synopsis "Machine Learning in Python") (synopsis "Machine Learning in Python")
(description (description
"Scikit-learn provides simple and efficient tools for data "Scikit-learn provides simple and efficient tools for data mining and
mining and data analysis.") data analysis.")
(license license:bsd-3))) (license license:bsd-3)))
(define-public python2-scikit-learn (define-public python2-scikit-learn