[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
75/232: gnu: python-scipy: Update to 1.8.0 and enable parallel build.
From: |
guix-commits |
Subject: |
75/232: gnu: python-scipy: Update to 1.8.0 and enable parallel build. |
Date: |
Sun, 24 Apr 2022 23:58:44 -0400 (EDT) |
apteryx pushed a commit to branch wip-ipython-polyglossia
in repository guix.
commit 5e8cd8e3f88871a074d786307d6eb7d2880628cc
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
- 50/232: gnu: Add python-types-docutils., (continued)
- 50/232: gnu: Add python-types-docutils., guix-commits, 2022/04/24
- 49/232: gnu: python-mypy: Update to 0.942 and fix search path., guix-commits, 2022/04/24
- 53/232: gnu: Add python-jaraco-context., guix-commits, 2022/04/24
- 54/232: gnu: Add python-jaraco-functools., guix-commits, 2022/04/24
- 57/232: gnu: Add python-pip-run., guix-commits, 2022/04/24
- 59/232: gnu: Add python-pytest-perf., guix-commits, 2022/04/24
- 63/232: gnu: Add psautohint-font-data., guix-commits, 2022/04/24
- 66/232: gnu: Add python-xdoctest., guix-commits, 2022/04/24
- 70/232: gnu: python-pytest-shutil: Adjust to use python-path., guix-commits, 2022/04/24
- 72/232: gnu: Add python-scikit-build., guix-commits, 2022/04/24
- 75/232: gnu: python-scipy: Update to 1.8.0 and enable parallel build.,
guix-commits <=
- 25/232: gnu: python-fonttools-with-test: Rename to python-fonttools-full., guix-commits, 2022/04/24
- 27/232: gnu: Add python-fontpens-bootstrap., guix-commits, 2022/04/24
- 38/232: gnu: Add python-jaraco-context-bootstrap., guix-commits, 2022/04/24
- 39/232: gnu: Add python-jaraco-functools-bootstrap., guix-commits, 2022/04/24
- 40/232: gnu: Add python-autocommand., guix-commits, 2022/04/24
- 35/232: gnu: Add python-ufonormalizer., guix-commits, 2022/04/24
- 43/232: gnu: Add python-pytest-freezegun., guix-commits, 2022/04/24
- 48/232: gnu: python-pytest-black: Update to 0.3.12., guix-commits, 2022/04/24
- 51/232: gnu: python-pytest-checkdocs: Update to 2.7.1., guix-commits, 2022/04/24
- 23/232: gnu: Add python-fontmath., guix-commits, 2022/04/24