From patchwork Wed Sep 14 21:42:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marius Bakke X-Patchwork-Id: 42630 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 A31DF27BBED; Wed, 14 Sep 2022 22:43:13 +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_INVALID, DKIM_SIGNED,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 A674F27BBE9 for ; Wed, 14 Sep 2022 22:43:12 +0100 (BST) Received: from localhost ([::1]:47370 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oYaA3-00056l-Sa for patchwork@mira.cbaines.net; Wed, 14 Sep 2022 17:43:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50914) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oYa9u-00056V-Cd for guix-patches@gnu.org; Wed, 14 Sep 2022 17:43:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39529) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oYa9u-0002F1-3q for guix-patches@gnu.org; Wed, 14 Sep 2022 17:43:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oYa9t-0001G6-RU for guix-patches@gnu.org; Wed, 14 Sep 2022 17:43:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57814] [PATCH 1/2] gnu: Add meson-python. Resent-From: Marius Bakke Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 14 Sep 2022 21:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57814 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57814@debbugs.gnu.org Received: via spool by 57814-submit@debbugs.gnu.org id=B57814.16631917424778 (code B ref 57814); Wed, 14 Sep 2022 21:43:01 +0000 Received: (at 57814) by debbugs.gnu.org; 14 Sep 2022 21:42:22 +0000 Received: from localhost ([127.0.0.1]:56457 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oYa9G-0001Ey-7I for submit@debbugs.gnu.org; Wed, 14 Sep 2022 17:42:22 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34676) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oYa9E-0001Ek-VA for 57814@debbugs.gnu.org; Wed, 14 Sep 2022 17:42:21 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:50930) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oYa99-000248-Pt for 57814@debbugs.gnu.org; Wed, 14 Sep 2022 17:42:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=1vsEpNpvcz0glvPwMdhih/BHhDnw+cU2dMvED5e/NXw=; b=ZOEVZpKr3/hLw/yomDCP VKZPg/zWQa173sfUp5uaQPAqYpa1zWoSX8uA5lK4qJ5CIljepQybN305Z8BRwuI5zlvdHM6N06Rvm kY4fFmWqW75Gtu3w3HMhiEYlT0e9AXCxZddcGFa3MJv2bld6McHOrBR7qOcJRecjVb1EIjPsJGGK0 ByUhxI0nKUfVAhzQH2aSiq/Y4NHRBZCjT2x82v9rwshHT5HQLUGst81o/JGwe2UiKubOCiKTXHmAq dFbzxiGuuOhDiVoX7VA2JBMgRT728Had4RvNKlSXYbyuSt8AuWhEdien91rfL1w+LOBzNDQHRtAkm XKpFKn0DdnZoZA==; Received: from [84.214.173.6] (port=56258 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oYa99-0002Uj-5A for 57814@debbugs.gnu.org; Wed, 14 Sep 2022 17:42:15 -0400 From: Marius Bakke Date: Wed, 14 Sep 2022 23:42:09 +0200 Message-Id: <20220914214210.16228-1-marius@gnu.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220914213630.15597-1-marius@gnu.org> References: <20220914213630.15597-1-marius@gnu.org> 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/build-tools.scm (meson-python): New variable. --- gnu/packages/build-tools.scm | 79 +++++++++++++++++++++++++++++++++++- 1 file changed, 78 insertions(+), 1 deletion(-) diff --git a/gnu/packages/build-tools.scm b/gnu/packages/build-tools.scm index b5b9d501f9..84a62d0fd6 100644 --- a/gnu/packages/build-tools.scm +++ b/gnu/packages/build-tools.scm @@ -45,9 +45,11 @@ (define-module (gnu packages build-tools) #:use-module (gnu packages check) #:use-module (gnu packages compression) #:use-module (gnu packages cpp) + #:use-module (gnu packages elf) #:use-module (gnu packages linux) #:use-module (gnu packages logging) #:use-module (gnu packages lua) + #:use-module (gnu packages ninja) #:use-module (gnu packages package-management) #:use-module (gnu packages pcre) #:use-module (gnu packages pkg-config) @@ -62,7 +64,7 @@ (define-module (gnu packages build-tools) #:use-module (gnu packages rpc) #:use-module (gnu packages sqlite) #:use-module (gnu packages tls) - #:use-module (gnu packages ninja) + #:use-module (gnu packages version-control) #:use-module (guix build-system gnu) #:use-module (guix build-system python)) @@ -342,6 +344,81 @@ (define-public meson-0.59 ;; TODO: Bump this in the next rebuild cycle. (define-public meson meson-0.60) +(define-public meson-python + (package + (name "meson-python") + (version "0.8.1") + (source (origin + (method url-fetch) + (uri (pypi-uri "meson_python" version)) + (sha256 + (base32 + "0k2yn0iws1n184sdznzmfw4xgbqgq5cn02hpc7m0xdaxryj1ybs4")))) + (build-system python-build-system) + (arguments + (list #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'avoid-ninja-dependency + (lambda _ + ;; Avoid dependency on the "ninja" PyPI distribution, + ;; which is a meta-package that simply downloads and + ;; installs ninja from the web ... + (substitute* "pyproject.toml" + (("'ninja',") + "")))) + (replace 'build + (lambda _ + ;; ZIP does not support timestamps before 1980. + (setenv "SOURCE_DATE_EPOCH" "315532800") + (invoke "python" "-m" "build" "--wheel" "--no-isolation" "."))) + (replace 'install + (lambda _ + (let ((whl (car (find-files "dist" "\\.whl$")))) + (invoke "pip" "--no-cache-dir" "--no-input" + "install" "--no-deps" "--prefix" #$output whl)))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "pytest" "-vv" "tests" "-k" + (string-append + "not " + ;; These tests require a git checkout. + (string-join '("test_contents_unstaged" + "test_no_pep621" + "test_pep621" + "test_dynamic_version" + "test_contents" + "test_contents_subdirs") + " and not "))))))))) + (propagated-inputs + (list meson-0.63 ;>=0.62 required + ninja + ;; XXX: python-meson forcefully sets the RUNPATH of binaries + ;; for vendoring purposes, and uses PatchELF for that(!). This + ;; functionality is not useful in Guix, but removing this + ;; dependency is tricky. There is discussion upstream about making + ;; it optional, but for now we'll just carry it: + ;; https://github.com/FFY00/meson-python/issues/125 + patchelf + python-colorama + python-pyproject-metadata + python-tomli + python-wheel)) + (native-inputs + (list python-pypa-build + python-wheel + + ;; For tests. + pkg-config + python-gitpython + python-pytest + python-pytest-mock)) + (home-page "https://github.com/FFY00/mesonpy") + (synopsis "Meson-based build backend for Python") + (description + "meson-python is a PEP 517 build backend for Meson projects.") + (license license:expat))) + (define-public premake4 (package (name "premake") From patchwork Wed Sep 14 21:42:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marius Bakke X-Patchwork-Id: 42631 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 CCFBE27BBE9; Wed, 14 Sep 2022 22:43:14 +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_INVALID, DKIM_SIGNED,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 31CA327BBEA for ; Wed, 14 Sep 2022 22:43:13 +0100 (BST) Received: from localhost ([::1]:47372 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oYaA4-00056n-Bp for patchwork@mira.cbaines.net; Wed, 14 Sep 2022 17:43:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50916) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oYa9u-00056c-SL for guix-patches@gnu.org; Wed, 14 Sep 2022 17:43:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39530) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oYa9u-0002F6-Ff for guix-patches@gnu.org; Wed, 14 Sep 2022 17:43:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oYa9u-0001GD-AH for guix-patches@gnu.org; Wed, 14 Sep 2022 17:43:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57814] [PATCH 2/2] gnu: python-scipy: Update to 1.9.1. Resent-From: Marius Bakke Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 14 Sep 2022 21:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57814 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57814@debbugs.gnu.org Received: via spool by 57814-submit@debbugs.gnu.org id=B57814.16631917494797 (code B ref 57814); Wed, 14 Sep 2022 21:43:02 +0000 Received: (at 57814) by debbugs.gnu.org; 14 Sep 2022 21:42:29 +0000 Received: from localhost ([127.0.0.1]:56461 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oYa9M-0001FI-Qx for submit@debbugs.gnu.org; Wed, 14 Sep 2022 17:42:29 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34678) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oYa9H-0001En-EG for 57814@debbugs.gnu.org; Wed, 14 Sep 2022 17:42:27 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:38022) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oYa9C-00024O-8X for 57814@debbugs.gnu.org; Wed, 14 Sep 2022 17:42:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=pUp9zRQ/Fh8ozb/VvPWSn0aNKnoAasXQa4R1PAqZMFA=; b=Iq4PkMO2TxKjOof/B7AA +PPl2Ho8aBzDxj2Lp0U00aBCq+qozqyEWyiNbIJTFgA77Blw/gieJuctj+wkm8EsLgz23tNa2vHCG zOA9gL8EDUO9Ib8126ZAmwLy2snwxcUWTt/FCqIX/KG1gDLFVT2a0DZLsOXwsUB6Xe5GAQLpo2XWl zvKQQImnPA3AeK8sh/sahbIFqhIP7vCwIMyqb5Zl86UdZKfCokPun6DtAE6ilkhRDDNYPjRnmB+sJ nPyEhkRkFXDhXRaj5CsfIdXQ2TkZxxaBfDz81nijd+r6M3/eUuFUcxSC0KqUnhreFx15nu4302/89 tucNByXJImzQDQ==; Received: from [84.214.173.6] (port=46810 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oYa9B-0002VA-Jz for 57814@debbugs.gnu.org; Wed, 14 Sep 2022 17:42:18 -0400 From: Marius Bakke Date: Wed, 14 Sep 2022 23:42:10 +0200 Message-Id: <20220914214210.16228-2-marius@gnu.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220914214210.16228-1-marius@gnu.org> References: <20220914213630.15597-1-marius@gnu.org> <20220914214210.16228-1-marius@gnu.org> 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): Update to 1.9.1. [source]: Switch to GIT-FETCH. [outputs]: Remove. [arguments]: Don't disable Pythran. Don't configure OpenBLAS which is now discovered by pkg-config. Do a "manual" PEP 517 style build. Make install-doc phase conditional on the presence of Sphinx. Simplify tests. [propagated-inputs]: Add PYTHON-PYTHRAN. [native-inputs]: Remove PERL, WHICH, PYTHON-NUMPYDOC, PYTHON-PYDATA-SPHINX-THEME, PYTHON-SPHINX, and PYTHON-SPHINX-PANELS. Add GCC, PKG-CONFIG, PYTHON-PYPA-BUILD and PYTHON-MESON. --- gnu/packages/python-science.scm | 112 +++++++++++++++++--------------- 1 file changed, 59 insertions(+), 53 deletions(-) diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm index 9a75bf3089..d1698e5f67 100644 --- a/gnu/packages/python-science.scm +++ b/gnu/packages/python-science.scm @@ -42,6 +42,7 @@ (define-module (gnu packages python-science) #:use-module (gnu packages base) #:use-module (gnu packages bioinformatics) #:use-module (gnu packages boost) + #:use-module (gnu packages build-tools) #:use-module (gnu packages check) #:use-module (gnu packages cpp) #:use-module (gnu packages databases) @@ -75,81 +76,86 @@ (define-module (gnu packages python-science) (define-public python-scipy (package (name "python-scipy") - (version "1.8.0") + (version "1.9.1") (source (origin (method url-fetch) (uri (pypi-uri "scipy" version)) (sha256 - (base32 "1gghkwn93niyasm36333xbqrnn3yiadq9d97wnc9mg14nzbg5m1i")))) - (outputs '("out" "doc")) + (base32 "1jcb94xal7w7ax80kaivqqics36v8smi4a3xngyxbrh0i538rli6")))) (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 - (lambda _ - (setenv "SCIPY_USE_PYTHRAN" "0"))) - (add-before 'build 'change-home-dir + (add-after 'unpack 'loosen-requirements (lambda _ - ;; Change from /homeless-shelter to /tmp for write permission. - (setenv "HOME" "/tmp"))) - (add-before 'build 'configure-openblas + (substitute* "pyproject.toml" + (("numpy==") "numpy>=") + (("meson==") "meson>=")))) + (replace 'build (lambda _ - (call-with-output-file "site.cfg" - (lambda (port) - (format port - "\ -[blas] -libraries = openblas -library_dirs = ~a/lib -include_dirs = ~:*~a/include - -[atlas] -library_dirs = ~:*~a/lib -atlas_libs = openblas~%" #$(this-package-input "openblas")))))) - (add-before 'build 'parallelize-build + ;; ZIP does not support timestamps before 1980. + (setenv "SOURCE_DATE_EPOCH" "315532800") + (invoke "python" "-m" "build" "--wheel" "--no-isolation" "."))) + (replace 'install (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"))) - (with-directory-excursion "doc" - ;; 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) - (copy-recursively "build/html" html))))) + (let ((whl (car (find-files "dist" "\\.whl$")))) + (invoke "pip" "--no-cache-dir" "--no-input" + "install" "--no-deps" "--prefix" #$output whl)))) (replace 'check (lambda* (#:key tests? #:allow-other-keys) (when tests? - (invoke "./runtests.py" "-vv" "--no-build" "--mode=fast" - "-j" (number->string (parallel-job-count))))))))) - (propagated-inputs (list python-numpy python-matplotlib python-pyparsing)) + ;; Step out of the source directory to avoid interference. + (with-directory-excursion "/tmp" + (invoke "python" "-c" + (string-append + "import scipy; scipy.test('fast', parallel=" + (number->string (parallel-job-count)) + ", verbose=2)")))))) + (add-after 'check 'install-doc + (lambda* (#:key outputs #:allow-other-keys) + ;; FIXME: Documentation cannot be built because it requires + ;; a newer version of pydata-sphinx-theme, which currently + ;; cannot build without internet access: + ;; . + ;; Keep the phase for easy testing. + (let ((sphinx-build (false-if-exception + (search-input-file input "bin/sphinx-build")))) + (if sphinx-build + (let* ((doc (assoc-ref outputs "doc")) + (data (string-append doc "/share")) + (docdir (string-append + data "/doc/" + #$(package-name this-package) "-" + #$(package-version this-package))) + (html (string-append docdir "/html"))) + (with-directory-excursion "doc" + ;; 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) + (copy-recursively "build/html" html))) + (format #t "sphinx-build not found, skipping~%")))))))) + (propagated-inputs + (list python-numpy python-matplotlib python-pyparsing python-pythran)) (inputs (list openblas pybind11)) (native-inputs (list gfortran - perl + ;; XXX: Adding gfortran shadows GCC headers, causing a compilation + ;; failure. Somehow also providing GCC works around it ... + gcc + meson-python + pkg-config python-cython - python-numpydoc - python-pydata-sphinx-theme + python-pypa-build python-pytest python-pytest-xdist - python-sphinx - python-sphinx-panels - python-threadpoolctl - which)) + python-threadpoolctl)) (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