From patchwork Sun May 23 17:54:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinicius Monego X-Patchwork-Id: 29518 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 A3EEE27BC81; Sun, 23 May 2021 18:55:11 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, T_DKIM_INVALID,URIBL_BLOCKED,URIBL_SBL,URIBL_SBL_A autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id A0CF327BC78 for ; Sun, 23 May 2021 18:55:10 +0100 (BST) Received: from localhost ([::1]:51922 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lksJh-000381-SP for patchwork@mira.cbaines.net; Sun, 23 May 2021 13:55:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55446) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lksJa-00037C-AR for guix-patches@gnu.org; Sun, 23 May 2021 13:55:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:58424) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lksJa-0001AT-3H for guix-patches@gnu.org; Sun, 23 May 2021 13:55:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lksJa-0000uO-1S for guix-patches@gnu.org; Sun, 23 May 2021 13:55:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48046] [PATCH]: Gnu add astropy Resent-From: Vinicius Monego Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 23 May 2021 17:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48046 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Sharlatan Hellseher Cc: 48046@debbugs.gnu.org Received: via spool by 48046-submit@debbugs.gnu.org id=B48046.16217924883468 (code B ref 48046); Sun, 23 May 2021 17:55:01 +0000 Received: (at 48046) by debbugs.gnu.org; 23 May 2021 17:54:48 +0000 Received: from localhost ([127.0.0.1]:41737 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lksJD-0000th-0R for submit@debbugs.gnu.org; Sun, 23 May 2021 13:54:48 -0400 Received: from mout01.posteo.de ([185.67.36.65]:60531) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lksJ9-0000tQ-9e for 48046@debbugs.gnu.org; Sun, 23 May 2021 13:54:37 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id EAE53240029 for <48046@debbugs.gnu.org>; Sun, 23 May 2021 19:54:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1621792469; bh=wbV5Siw8dUKOYG18USPiecweUxlgjX6LjFqXXPBqlY0=; h=Subject:From:To:Cc:Date:From; b=h5qeemRJGn4D6EaOvMMsz+IkLIeqAfojtMcr2wajrYg/JmdVzfkgmfieHzSZ9ng1l Ad9eat2ZY5Cjp25ZRSxD/noQUVXz5KFb/aGRZ12Qe1FpD5JiAYV6mCaPEvj9Q/j5W+ v/UIeP9Kbf8b6AA50gZ+B+4XuW5fQg71uMoHarT4kU7fkwgqbJ5+nkmhd+iXGS8L3r XNARafzKGe/JKMNimrTbNDhXeAcAkoU+RzeP7ParlI2y0tAcFoDRzI+QN/XrPY08XE kmOr9JQfrociexLhoVxVajkTQ5veNvtGug/4hPuyuHzvZlW1ELBU3PAdcyY3DHNfV8 PE3GNLDglKZ7w== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Fp7Jd6WW6z6tm6; Sun, 23 May 2021 19:54:25 +0200 (CEST) Message-ID: <7055d87cdde449415e62f0b0c15d96deb378af67.camel@posteo.net> From: Vinicius Monego Date: Sun, 23 May 2021 17:54:08 +0000 In-Reply-To: References: 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 Hi Sharlatan, Thanks for continuing the work on the astropy package, I managed to finish it this time. I am resending your patch with the following modifications: - Moved the package definition from the bottom to the middle of the file (to avoid merge conflicts) - Removed all optional inputs and propagated the remaining. I left only those listed in install_requires, setup_requires, test_requires and test[extras] in setup.cfg - Changed synopsis and description - Changed package labels to match the package name - Made the compiler file writable instead of deleting it - Deleted the makdir-astropy phase (it wasn't needed) - Added license for the jquery bundle that is not replaced and then I made my own improvements on that patch: enabling tests and unbundling some external libraries. I removed the optional packages because astropy is a core package, which will be a dependency for its many extensions. It's important that it builds with a high probability of success or the chain will break. Some of its optional dependencies, e.g. Pandas, have a broken build in aarch64 at the moment. The "full" astropy package could be installed easily from a manifest file and the tests can run again with astropy.test(). > the project heavily depends on TOX which requires pip to install > missing dependencies for itself. I don't think that a project can heavily depend on tox, all it does is manage a virtual environment with dependencies to run the tests. Guix does the same so tox is redundant here. Tests will still run with the testing framework. Two more suggestions for future Python patches: > + (replace 'check > + (lambda* (#:key inputs outputs #:allow-other-keys) > + (add-installed-pythonpath inputs outputs) > + (invoke "pytest" "-vv"))) When a project contains tests as part of the application code, as in Astropy, tests should run with "pytest --pyargs module". See Pytest Integration Pratices: https://docs.pytest.org/en/documentation-restructure/background/goodpractices.html It's also good practice in Guix to use (when tests?) when overriding the check phase to allow --without-tests=pkg. > ImportError: You appear to be trying to import astropy from within a > source checkout or from an editable installation without building the > extension modules first. Either run: I fixed this error by running the second command before the tests. If you don't mind the modifications I did, I will call this patchset complete and wait for a committer to review. Vinicius From be70ce67532c8b5c14bebdf3a4c0ce483bc86530 Mon Sep 17 00:00:00 2001 From: Vinicius Monego Date: Sat, 22 May 2021 15:09:37 -0300 Subject: [PATCH 6/6] gnu: python-astropy: Unbundle ply and configobj. * gnu/packages/astronomy.scm (python-astropy)[arguments]: Replace references to external ply and configobj and delete the bundles. [propagated-inputs]: Add python-ply, python-configobj. --- gnu/packages/astronomy.scm | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/gnu/packages/astronomy.scm b/gnu/packages/astronomy.scm index d9785696bb..17617eef9b 100644 --- a/gnu/packages/astronomy.scm +++ b/gnu/packages/astronomy.scm @@ -583,7 +583,25 @@ accurately in real time at any rate desired.") (setenv "HOME" "/tmp") ;; Relax xfail tests. (substitute* "setup.cfg" - (("xfail_strict = true") "xfail_strict = false")))) + (("xfail_strict = true") "xfail_strict = false")) + ;; Delete ply and configobj because we have them. They are not + ;; covered by ASTROPY_USE_SYSTEM_ALL. + (with-directory-excursion "astropy/extern" + (for-each delete-file-recursively '("ply" "configobj"))) + ;; Replace all references to external ply. + (let ((ply-files '("coordinates/angle_utilities.py" + "units/format/cds.py" + "units/format/ogip.py" + "units/format/generic.py"))) + (with-directory-excursion "astropy" + (map (lambda (file) + (substitute* file (("astropy.extern.ply") + "ply"))) + ply-files))) + ;; Replace reference to external configobj. + (with-directory-excursion "astropy/config" + (substitute* "configuration.py" + (("from astropy.extern.configobj ") ""))) )) ;; This file is opened in both install and check phases. (add-before 'install 'writable-compiler (lambda _ (make-file-writable "astropy/_compiler.c"))) @@ -617,7 +635,9 @@ accurately in real time at any rate desired.") ;; accepts. Version 7.5 will not be validated in the build. ("wcslib" ,wcslib-7.3))) (propagated-inputs - `(("python-numpy" ,python-numpy) + `(("python-configobj" ,python-configobj) + ("python-numpy" ,python-numpy) + ("python-ply" ,python-ply) ("python-pyerfa" ,python-pyerfa))) (home-page "https://www.astropy.org/") (synopsis "Core package for Astronomy in Python") -- 2.31.1