[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
75/204: gnu: python-scipy: Update to 1.8.0 and enable parallel build.
From: |
guix-commits |
Subject: |
75/204: gnu: python-scipy: Update to 1.8.0 and enable parallel build. |
Date: |
Wed, 20 Apr 2022 02:03:23 -0400 (EDT) |
apteryx pushed a commit to branch wip-ipython-polyglossia
in repository guix.
commit 08f499ac079583ad042b489c44b4fa334d35eebb
Author: Maxim Cournoyer <maxim.cournoyer@gmail.com>
AuthorDate: Wed Apr 6 22:24:48 2022 -0400
gnu: python-scipy: Update to 1.8.0 and enable parallel build.
* gnu/packages/python-science.scm (python-scipy): Update to 1.8.0.
[modules]: New argument.
[phases]{disable-broken-tests}: Delete phase.
{configure-openblas}: Streamline configuration template.
{parallelize-build}: New phase.
{install-doc}: Move before 'check phase. Remove now extraneous
'add-installed-pythonpath' call. Remove the SPHINXBUILD and PYVER Make
variables, as well as conf.py patching. Provide SPHINXOPTS to build doc in
parallel. Simply recursively copy the 'html' output directory to install
the
doc.
{check}: Remove extraneous INPUTS and OUTPUTS arguments. Start tests with
the
'runtests.py' launcher, which accepts a '-j' argument to run the tests in
parallel.
[native-inputs]: Sort inputs. Add python-pytest-xdist and
python-threadpoolctl.
[home-page]: Update.
---
gnu/packages/python-science.scm | 91 ++++++++++++++++-------------------------
1 file changed, 36 insertions(+), 55 deletions(-)
diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index dfe6a66e61..1852a16047 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -72,17 +72,20 @@
(define-public python-scipy
(package
(name "python-scipy")
- (version "1.7.3")
+ (version "1.8.0")
(source
(origin
(method url-fetch)
(uri (pypi-uri "scipy" version))
(sha256
- (base32 "1gxsnw6viz2j3sm8ak2a8l7fcn4b2zm3kzfm8w57xxyyrzx7an5b"))))
+ (base32 "1gghkwn93niyasm36333xbqrnn3yiadq9d97wnc9mg14nzbg5m1i"))))
(outputs '("out" "doc"))
(build-system python-build-system)
(arguments
(list
+ #:modules '((guix build utils)
+ (guix build python-build-system)
+ (ice-9 format))
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'disable-pythran
@@ -92,81 +95,59 @@
(lambda _
;; Change from /homeless-shelter to /tmp for write permission.
(setenv "HOME" "/tmp")))
- (add-after 'unpack 'disable-broken-tests
- (lambda _
- (substitute* "scipy/sparse/linalg/dsolve/tests/test_linsolve.py"
- (("^( +)def test_threads_parallel\\(self\\):" m indent)
- (string-append indent
- "@pytest.mark.skip(reason=\"Disabled by
Guix\")\n"
- m)))
- (substitute*
"scipy/sparse/linalg/eigen/arpack/tests/test_arpack.py"
- (("^def test_parallel_threads\\(\\):" m)
- (string-append "@pytest.mark.skip(reason=\"Disabled by
Guix\")\n"
- m)))))
(add-before 'build 'configure-openblas
(lambda _
(call-with-output-file "site.cfg"
(lambda (port)
(format port
- "[blas]
+ "\
+[blas]
libraries = openblas
library_dirs = ~a/lib
-include_dirs = ~a/include
+include_dirs = ~:*~a/include
-# backslash-n to make emacs happy
-\n[atlas]
-library_dirs = ~a/lib
-atlas_libs = openblas
-"
- #$(this-package-input "openblas")
- #$(this-package-input "openblas")
- #$(this-package-input "openblas"))))))
- (add-after 'install 'install-doc
- (lambda* (#:key inputs outputs #:allow-other-keys)
+[atlas]
+library_dirs = ~:*~a/lib
+atlas_libs = openblas~%" #$(this-package-input "openblas"))))))
+ (add-before 'build 'parallelize-build
+ (lambda _
+ (setenv "NPY_NUM_BUILD_JOBS"
+ (number->string (parallel-job-count)))))
+ (add-before 'check 'install-doc
+ (lambda* (#:key outputs #:allow-other-keys)
(let* ((data (string-append (assoc-ref outputs "doc") "/share"))
(doc (string-append data "/doc/" #$name "-" #$version))
- (html (string-append doc "/html"))
- (pyver (string-append "PYVER="
- #$(version-major+minor
- (package-version python))))
- ;; By default it tries to run sphinx-build through the
Python
- ;; interpreter which won't work with our shell wrapper.
- (sphinxbuild "SPHINXBUILD=LANG=C sphinx-build"))
- ;; Make installed package available for building the
- ;; documentation
- (add-installed-pythonpath inputs outputs)
+ (html (string-append doc "/html")))
(with-directory-excursion "doc"
- ;; Fix generation of images for mathematical expressions.
- (substitute* (find-files "source" "conf\\.py")
- (("pngmath_use_preview = True")
- "pngmath_use_preview = False"))
+ ;; Build doc.
+ (invoke "make" "html"
+ ;; Building the documentation takes a very long time.
+ ;; Parallelize it.
+ (string-append "SPHINXOPTS=-j"
+ (number->string
(parallel-job-count))))
+ ;; Install doc.
(mkdir-p html)
- (invoke "make" "html" pyver sphinxbuild)
- (with-directory-excursion "build/html"
- (for-each (lambda (file)
- (let* ((dir (dirname file))
- (tgt-dir (string-append html "/" dir)))
- (install-file file html)))
- (find-files ".")))))))
+ (copy-recursively "build/html" html)))))
(replace 'check
- (lambda* (#:key tests? inputs outputs #:allow-other-keys)
+ (lambda* (#:key tests? #:allow-other-keys)
(when tests?
- (with-directory-excursion "/tmp"
- (invoke "python" "-c"
- "import scipy; scipy.test(verbose=2)"))))))))
+ (invoke "./runtests.py" "-vv" "--no-build" "--mode=fast"
+ "-j" (number->string (parallel-job-count)))))))))
(propagated-inputs (list python-numpy python-matplotlib python-pyparsing))
(inputs (list openblas pybind11))
(native-inputs
- (list python-cython
+ (list gfortran
+ perl
+ python-cython
+ python-numpydoc
python-pydata-sphinx-theme
python-pytest
+ python-pytest-xdist
python-sphinx
python-sphinx-panels
- python-numpydoc
- gfortran
- perl
+ python-threadpoolctl
which))
- (home-page "https://www.scipy.org/")
+ (home-page "https://scipy.org/")
(synopsis "The Scipy library provides efficient numerical routines")
(description "The SciPy library is one of the core packages that make up
the SciPy stack. It provides many user-friendly and efficient numerical
- 51/204: gnu: python-pytest-checkdocs: Update to 2.7.1., (continued)
- 51/204: gnu: python-pytest-checkdocs: Update to 2.7.1., guix-commits, 2022/04/20
- 58/204: gnu: Add python-tempora., guix-commits, 2022/04/20
- 62/204: gnu: Add python-pytest-randomly., guix-commits, 2022/04/20
- 63/204: gnu: Add psautohint-font-data., guix-commits, 2022/04/20
- 47/204: gnu: python-importlib-metadata: Update to 4.11.3., guix-commits, 2022/04/20
- 64/204: gnu: Add psautohint., guix-commits, 2022/04/20
- 67/204: gnu: Add python-ubelt., guix-commits, 2022/04/20
- 71/204: gnu: python-pytest-cov: Update to 3.0.0., guix-commits, 2022/04/20
- 73/204: gnu: python-jupyter-packaging: Update to 0.12.0, run test suite., guix-commits, 2022/04/20
- 74/204: gnu: python-scipy: Move input fields below arguments field., guix-commits, 2022/04/20
- 75/204: gnu: python-scipy: Update to 1.8.0 and enable parallel build.,
guix-commits <=
- 77/204: gnu: Add python-fonttools-next., guix-commits, 2022/04/20
- 80/204: gnu: Add skia., guix-commits, 2022/04/20
- 85/204: gnu: Add python-sfdlib., guix-commits, 2022/04/20
- 88/204: gnu: Add texlive-bidi., guix-commits, 2022/04/20
- 89/204: gnu: Add font-gfs-ambrosia., guix-commits, 2022/04/20
- 92/204: gnu: Add python-untangle., guix-commits, 2022/04/20
- 96/204: gnu: Add python-pydevd., guix-commits, 2022/04/20
- 100/204: gnu: python-pytest-xdist-next: Update to 2.5.0., guix-commits, 2022/04/20
- 102/204: gnu: python-nest-asyncio: Update to 1.5.5., guix-commits, 2022/04/20
- 116/204: gnu: python-send2trash: Update to 1.8.0 and update home page., guix-commits, 2022/04/20