From patchwork Mon Apr 25 03:56:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 38868 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 25F5F27BBEA; Mon, 25 Apr 2022 05:24:20 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 737DE27BBE9 for ; Mon, 25 Apr 2022 05:24:19 +0100 (BST) Received: from localhost ([::1]:47498 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1niqGn-0003Oe-QP for patchwork@mira.cbaines.net; Mon, 25 Apr 2022 00:24:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38888) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nipvZ-00080O-Rk for guix-patches@gnu.org; Mon, 25 Apr 2022 00:02:27 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:38795) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nipvX-0001nC-Ch for guix-patches@gnu.org; Mon, 25 Apr 2022 00:02:19 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nipvX-0008El-Au for guix-patches@gnu.org; Mon, 25 Apr 2022 00:02:19 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55104] [PATCH 074/232] gnu: python-scipy: Move input fields below arguments field. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 25 Apr 2022 04:02:19 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55104 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 55104@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 55104-submit@debbugs.gnu.org id=B55104.165085932731421 (code B ref 55104); Mon, 25 Apr 2022 04:02:19 +0000 Received: (at 55104) by debbugs.gnu.org; 25 Apr 2022 04:02:07 +0000 Received: from localhost ([127.0.0.1]:60868 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nipvD-00089O-Kt for submit@debbugs.gnu.org; Mon, 25 Apr 2022 00:02:06 -0400 Received: from mail-qt1-f182.google.com ([209.85.160.182]:46068) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1niptx-0007sO-9w for 55104@debbugs.gnu.org; Mon, 25 Apr 2022 00:00:46 -0400 Received: by mail-qt1-f182.google.com with SMTP id x21so124826qtr.12 for <55104@debbugs.gnu.org>; Sun, 24 Apr 2022 21:00:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=as22pkiNkB3qCe7RxwvSxjmLAhfnBSrDXH19jHhj1go=; b=a6Bpa3oT8UrRwKbulJHU015OHRlL/bfW7960a2bs55ijPaVrcFaW3OswZjpjgpmceS TiLKtp9LHfra6SMEtAwXgQyz8v4jnWMDkf4WQSr6Z3jWF4x68bKNoHYahQ0HAGlky+ys 0FDx7mYPxH+ArT3fqbWYGLySnDRdgDMFcRnSsHsX8Yp10ZNAH9tK7UoEmHSa70L1VeUN Ugs8Y3fqhUWfHDMrBHpOQxmdwJ5ShCy+wyIuepZtEeBBuW2BL9qfSXX/SqjUyF0m42L5 qU3yoy7hwfWKwz5x1aImIU7kzJtmzNPFbkxwFBP3hafwRxRsyoFr70wXdHg+JShM65U3 ZI/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=as22pkiNkB3qCe7RxwvSxjmLAhfnBSrDXH19jHhj1go=; b=bVgebq258UriTlD0SBqEV7iQglBwLbsgpCy51XZWM0bO2kT1zQGm9XOI82auD/rGBk CRnuxP/kiBxfxSF1SUvPLYqBe8XKYtwwXdhWmynq4w1/bLNMZ/SMcVeoAuo1Ell9EsR6 LjB3ITp6AvLKugrEw79yucn4smG2yv/CH7Tw6s797QyrSqX/x6BYnart862pK8KJq9IJ 6/OIB42/EomLfT7SdDeXDQGYf3niZaqPOYpaMgHRe/D/M4bmA6+G9UIfjUgFfmlDFE7/ 7xGQpOMOxP8bITdTn+uhR/zXOSNVvmdeL0FtoVy5Z+l2qa3TYXbHGKwIuyG8PRreUPI7 Z4TA== X-Gm-Message-State: AOAM530CXexszdi1oD6vpcHehJUSMgV9LCyVLk7yyUc5uXyNxPQgYGkz H2SyMyiPHpScIBh7dJYsMhl0MjWP5YhVbQ== X-Google-Smtp-Source: ABdhPJxTuEb1syC+CVCfy1m4rNeWih4vJmSUDeZ0eoZqzvYRbnjkhSnOh0zC+Gt6Bw6s6Uo757r0ig== X-Received: by 2002:a05:622a:28d:b0:2f3:67c7:cdff with SMTP id z13-20020a05622a028d00b002f367c7cdffmr2317154qtw.683.1650859235662; Sun, 24 Apr 2022 21:00:35 -0700 (PDT) Received: from localhost.localdomain (dsl-150-232.b2b2c.ca. [66.158.150.232]) by smtp.gmail.com with ESMTPSA id w82-20020a376255000000b0069ee3f0ae63sm4478142qkb.45.2022.04.24.21.00.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Apr 2022 21:00:35 -0700 (PDT) From: Maxim Cournoyer Date: Sun, 24 Apr 2022 23:56:40 -0400 Message-Id: <20220425035918.25683-74-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220425035918.25683-1-maxim.cournoyer@gmail.com> References: <20220425035918.25683-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/python-science.scm (python-scipy): Move inputs fields below the arguments field. [phases]: Use gexp. {configure-openblas}: Use this-package-input. {check}: Remove extraneous 'add-installed-pythonpath' call. {install-doc}: Adjust accordingly. --- gnu/packages/python-science.scm | 155 ++++++++++++++++---------------- 1 file changed, 77 insertions(+), 78 deletions(-) diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm index 07d713e013..dfe6a66e61 100644 --- a/gnu/packages/python-science.scm +++ b/gnu/packages/python-science.scm @@ -6,7 +6,7 @@ ;;; Copyright © 2016, 2022 Efraim Flashner ;;; Copyright © 2016-2020, 2022 Marius Bakke ;;; Copyright © 2019 Tobias Geerinckx-Rice -;;; Copyright © 2019, 2021 Maxim Cournoyer +;;; Copyright © 2019, 2021, 2022 Maxim Cournoyer ;;; Copyright © 2019 Giacomo Leidi ;;; Copyright © 2020 Pierre Langlois ;;; Copyright © 2020, 2021, 2022 Vinicius Monego @@ -79,49 +79,36 @@ (define-public python-scipy (uri (pypi-uri "scipy" version)) (sha256 (base32 "1gxsnw6viz2j3sm8ak2a8l7fcn4b2zm3kzfm8w57xxyyrzx7an5b")))) - (build-system python-build-system) - (propagated-inputs - (list python-numpy python-matplotlib python-pyparsing)) - (inputs - (list openblas pybind11)) - (native-inputs - (list python-cython - python-pydata-sphinx-theme - python-pytest - python-sphinx - python-sphinx-panels - python-numpydoc - gfortran - perl - which)) (outputs '("out" "doc")) + (build-system python-build-system) (arguments - `(#:phases - (modify-phases %standard-phases - (add-after 'unpack 'disable-pythran - (lambda _ - (setenv "SCIPY_USE_PYTHRAN" "0"))) - (add-before 'build 'change-home-dir - (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* (#:key inputs #:allow-other-keys) - (call-with-output-file "site.cfg" - (lambda (port) - (format port - "[blas] + (list + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'disable-pythran + (lambda _ + (setenv "SCIPY_USE_PYTHRAN" "0"))) + (add-before 'build 'change-home-dir + (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] libraries = openblas library_dirs = ~a/lib include_dirs = ~a/include @@ -131,42 +118,54 @@ (define-public python-scipy library_dirs = ~a/lib atlas_libs = openblas " - (assoc-ref inputs "openblas") - (assoc-ref inputs "openblas") - (assoc-ref inputs "openblas")))))) - (add-after 'install 'install-doc - (lambda* (#:key inputs 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) - (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")) - (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 "."))))))) - (replace 'check - (lambda* (#:key tests? inputs outputs #:allow-other-keys) - (when tests? - (add-installed-pythonpath inputs outputs) - (with-directory-excursion "/tmp" - (invoke "python" "-c" - "import scipy; scipy.test(verbose=2)")))))))) + #$(this-package-input "openblas") + #$(this-package-input "openblas") + #$(this-package-input "openblas")))))) + (add-after 'install 'install-doc + (lambda* (#:key inputs 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) + (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")) + (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 "."))))))) + (replace 'check + (lambda* (#:key tests? inputs outputs #:allow-other-keys) + (when tests? + (with-directory-excursion "/tmp" + (invoke "python" "-c" + "import scipy; scipy.test(verbose=2)")))))))) + (propagated-inputs (list python-numpy python-matplotlib python-pyparsing)) + (inputs (list openblas pybind11)) + (native-inputs + (list python-cython + python-pydata-sphinx-theme + python-pytest + python-sphinx + python-sphinx-panels + python-numpydoc + gfortran + perl + which)) (home-page "https://www.scipy.org/") (synopsis "The Scipy library provides efficient numerical routines") (description "The SciPy library is one of the core packages that make up