From patchwork Tue Jan 23 10:31:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sharlatan Hellseher X-Patchwork-Id: 59338 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 268DE27BBEB; Tue, 23 Jan 2024 10:32:13 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham 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 5D25727BBE9 for ; Tue, 23 Jan 2024 10:32:12 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSE4d-0007Wo-4J; Tue, 23 Jan 2024 05:32:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rSE4Z-0007Vk-Oa for guix-patches@gnu.org; Tue, 23 Jan 2024 05:32:05 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSE4Z-000654-F1; Tue, 23 Jan 2024 05:32:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rSE4Y-0006yV-HT; Tue, 23 Jan 2024 05:32:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68650] [PATCH v2 2/2] gnu: python-pyamg: Regenerate bundled files. Resent-From: Sharlatan Hellseher Original-Sender: "Debbugs-submit" Resent-CC: lars@6xq.net, marius@gnu.org, me@bonfacemunyoki.com, sharlatanus@gmail.com, jgart@dismail.de, guix-patches@gnu.org Resent-Date: Tue, 23 Jan 2024 10:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68650 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 68650@debbugs.gnu.org Cc: Sharlatan Hellseher , Lars-Dominik Braun , Marius Bakke , Munyoki Kilyungi , Sharlatan Hellseher , jgart X-Debbugs-Original-Xcc: Lars-Dominik Braun , Marius Bakke , Munyoki Kilyungi , Sharlatan Hellseher , jgart Received: via spool by 68650-submit@debbugs.gnu.org id=B68650.170600591526793 (code B ref 68650); Tue, 23 Jan 2024 10:32:02 +0000 Received: (at 68650) by debbugs.gnu.org; 23 Jan 2024 10:31:55 +0000 Received: from localhost ([127.0.0.1]:42266 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSE4R-0006y4-Az for submit@debbugs.gnu.org; Tue, 23 Jan 2024 05:31:55 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:44331) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSE4P-0006xl-R3 for 68650@debbugs.gnu.org; Tue, 23 Jan 2024 05:31:54 -0500 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-33934567777so2255651f8f.1 for <68650@debbugs.gnu.org>; Tue, 23 Jan 2024 02:31:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706005903; x=1706610703; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4Lq/hfV8jS5eFrb809zNXedJcUWWNzKrSnYPC6XAD8E=; b=kkdudNbqvI731qJh+LILFldu3GMLgQYL9lQtmnZArMo4kuZoNbiT9vRLHPOUCZ0BbT kZNolDFqhYwy79oFC+MqXzrZ6O7XY1PgqgQ18eSachlG20GWz/cgy59SQaXYoynIdUyg Xp+uyCGVWIjLy633YlXX5ms6MRm5iAaHWLiA1NwmviOEl6iNa2v9hxK1zEAEAT9m4TJ9 bxb8QPg8DTBC0H/9FT+WJW/9NMK7ArYStYNHFpXFmnTrPYtUL8DATThQiLV6vScRw9At cFJbWcrikRYlvBuaspgTyJ870hiUuC6YonDQ6lK81DTmWPt/k6/sYDcPrIPLCvGq249y 4s8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706005903; x=1706610703; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4Lq/hfV8jS5eFrb809zNXedJcUWWNzKrSnYPC6XAD8E=; b=ZrYvbG00MeVwbIZ/prQQI6eS3LYoKfYMGe3YMQLdO/9KD7G2cBAVhYNcSHOyz2CEvi xpVLDsk2HYOX4NNKP5vgJrTIMGNG8/ThEKSh1ZXRw1lG+IOc9D+fdmIDmJplWKlYCXcM P+m3v4rLv33u/xD9bkxiVt4Vk0nPMqWEOQxCqdeDbgR3SsmRdiGQoNEru2l0cE9vuDdn u2bx037l+smrnRRoSv6/qdlui36TnKXxl2QUKEhnAdoddY19yXGsn9znjdfIGhH/ZgwI a+nW7Gh1pBL1QD/JCiSPZj7tF/dry6HfgX3dG31qpGV4wYC9f9gyN5KWCd4RFO1YiJsJ bVjw== X-Gm-Message-State: AOJu0YwUlYrGK0h3j0WuzqI3UGtJqSMnDudNab0Nrfrfa5YmOSbJTBXX bEYKw2UeUjlNeWzODUq2p0nCjQjU86zhJa471Jegnwi0KzcDMURIUD+wiHf3RVM= X-Google-Smtp-Source: AGHT+IEOBzX1gNx23CH8/+LCcRLtIJDnPkO3GgCwaqdGP4LZh7rZVQdW8fmOKBjAwCzuq1Oa2V/9ow== X-Received: by 2002:adf:f44e:0:b0:337:c693:dc06 with SMTP id f14-20020adff44e000000b00337c693dc06mr3326594wrp.19.1706005902744; Tue, 23 Jan 2024 02:31:42 -0800 (PST) Received: from localhost.localdomain (cpc100856-bagu15-2-0-cust368.1-3.cable.virginm.net. [82.25.93.113]) by smtp.gmail.com with ESMTPSA id l8-20020a5d5608000000b003392bcd6c48sm7594200wrv.79.2024.01.23.02.31.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 02:31:42 -0800 (PST) From: Sharlatan Hellseher Date: Tue, 23 Jan 2024 10:31:37 +0000 Message-ID: <45dea5104e4c21d970f4ca6366376062e2d95a0d.1706005796.git.sharlatanus@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <9894a20af993d2e79aabba9e05bc0d47d333c3c4.1706005796.git.sharlatanus@gmail.com> References: <9894a20af993d2e79aabba9e05bc0d47d333c3c4.1706005796.git.sharlatanus@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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/python-science.scm (python-pyamg)[source]: Delete auto-generated files. [arguments]<#:phases>: Add 'amg-core-bind-them phase to re-generate *_bind.cpp files deleted in snippet. [native-inputs]: Add python-cppheaderparser and python-pyyaml. [description]: Improve style, omit implementation details. Change-Id: I6f68914cd912e6f4592e51c21b129847e73be847 --- gnu/packages/python-science.scm | 50 +++++++++++++++++++++++++++------ 1 file changed, 41 insertions(+), 9 deletions(-) diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm index c1be6cde23..4183bd2ea2 100644 --- a/gnu/packages/python-science.scm +++ b/gnu/packages/python-science.scm @@ -465,32 +465,64 @@ (define-public python-pyamg (source (origin (method url-fetch) (uri (pypi-uri "pyamg" version)) + (modules '((guix build utils))) + (snippet + ;; Delete autogenerated files, regenerate in a phase. + #~(begin + (for-each + (lambda (file) + (delete-file (string-append "pyamg/amg_core/" file))) + '("air_bind.cpp" + "evolution_strength_bind.cpp" + "graph_bind.cpp" + "krylov_bind.cpp" + "linalg_bind.cpp" + "relaxation_bind.cpp" + "ruge_stuben_bind.cpp" + "smoothed_aggregation_bind.cpp" + "tests/bind_examples_bind.cpp")))) (sha256 (base32 "0l3dliwynxyjvbgpmi2k8jqvkkw6fc00c8w69h6swhrkfh0ql12z")))) - (build-system pyproject-build-system) (arguments (list #:test-flags ;; Test installed package in order to find C++ modules. - #~(list "--pyargs" "pyamg.tests"))) - (native-inputs (list pybind11 python-pytest python-setuptools-scm)) + #~(list "--pyargs" "pyamg.tests") + #:phases + #~(modify-phases %standard-phases + ;; Regenerate the autogenerated files. + (add-after 'unpack 'amg-core-bind-them + (lambda _ + ;; bindthem.py heavily depends on location to produce *_bind.cpp + ;; file, make it available in tests as well. + (copy-file "pyamg/amg_core/bindthem.py" + "pyamg/amg_core/tests/bindthem.py") + (with-directory-excursion "pyamg/amg_core" + (substitute* "bindthem.py" + (("/usr/bin/env python3") (which "python3"))) + (invoke "sh" "generate.sh")) + (with-directory-excursion "pyamg/amg_core/tests" + (invoke "python" "bindthem.py" "bind_examples.h"))))))) + (build-system pyproject-build-system) + (native-inputs + (list pybind11 + python-cppheaderparser + python-pytest + python-pyyaml + python-setuptools-scm)) (propagated-inputs (list python-numpy python-scipy)) (home-page "https://github.com/pyamg/pyamg") (synopsis "Algebraic Multigrid Solvers in Python") (description "PyAMG is a Python library of Algebraic Multigrid -(AMG) solvers. - -PyAMG features implementations of: +(AMG) solvers. It features implementations of: @itemize @item Ruge-Stuben (RS) or Classical AMG @item AMG based on Smoothed Aggregation (SA) @item Adaptive Smoothed Aggregation (αSA) @item Compatible Relaxation (CR) @item Krylov methods such as CG, GMRES, FGMRES, BiCGStab, MINRES, etc. -@end itemize -PyAMG is primarily written in Python with supporting C++ code for -performance critical operations.") +@end itemize") (license license:expat))) (define-public python-tspex