From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id yCeeIcm0fGElWQEAgWs5BA (envelope-from ) for ; Sat, 30 Oct 2021 04:58:17 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id mDRNHcm0fGHyVwAAB5/wlQ (envelope-from ) for ; Sat, 30 Oct 2021 02:58:17 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 27181116A0 for ; Sat, 30 Oct 2021 04:58:17 +0200 (CEST) Received: from localhost ([::1]:53512 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mgeZU-0005CN-8f for larch@yhetil.org; Fri, 29 Oct 2021 22:58:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55748) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgeZJ-0005Bn-DP for guix-patches@gnu.org; Fri, 29 Oct 2021 22:58:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:44863) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mgeZF-0007Ae-O4 for guix-patches@gnu.org; Fri, 29 Oct 2021 22:58:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mgeZF-0006mK-NX for guix-patches@gnu.org; Fri, 29 Oct 2021 22:58:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48046] [PATCH v2 3/3] gnu: Add python-astropy. Resent-From: Vinicius Monego Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 30 Oct 2021 02:58: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: 48046@debbugs.gnu.org Cc: Sharlatan Hellseher Received: via spool by 48046-submit@debbugs.gnu.org id=B48046.163556263625990 (code B ref 48046); Sat, 30 Oct 2021 02:58:01 +0000 Received: (at 48046) by debbugs.gnu.org; 30 Oct 2021 02:57:16 +0000 Received: from localhost ([127.0.0.1]:56407 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgeYR-0006ky-Nh for submit@debbugs.gnu.org; Fri, 29 Oct 2021 22:57:16 -0400 Received: from mout02.posteo.de ([185.67.36.66]:55343) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgeYP-0006kj-P6 for 48046@debbugs.gnu.org; Fri, 29 Oct 2021 22:57:10 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 17241240103 for <48046@debbugs.gnu.org>; Sat, 30 Oct 2021 04:57:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1635562624; bh=HeKFZ4Ufv3XzPwPyPhaPdRe0UVfGV6uV//YxWQYDNE4=; h=From:To:Cc:Subject:Date:From; b=LV/jvJpXTODacdRrEePLk4Xu25Dy6N8giuu+p3Io837wgtzXMuMBFw4iRv1BVuC1d 1fvgop0rvdd7CTMes6McDirsVi5nECAm6yh5z0LQ8W+xAzPQKxJpSCiQPWFNYt4FlJ veJyeQrw2TkyFVQR2gmyhxVW9kjYTvx6wFZD8N8DYgGzlWCy+nypDB/eafooJyl8XH ABAabGSPC2lJIhf0xgRHyB3N4nXBAE1B0J7nuIPMtqn1PVQUHfIb3BphjpiwI8g9oH jVR1DxtkvmPfRi6ldk8DjcBUCSOHsEjabHwBOpDBd9rgjG7QXrYeXnf78SZB0zaCSe mDuQXlI+yW5rw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Hh3qM0bbHz6tm5; Sat, 30 Oct 2021 04:57:02 +0200 (CEST) From: Vinicius Monego Date: Sat, 30 Oct 2021 02:51:33 +0000 Message-Id: <20211030025133.23186-4-monego@posteo.net> In-Reply-To: <20211030025133.23186-1-monego@posteo.net> References: <20211030025133.23186-1-monego@posteo.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1635562697; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=rpkMMjdmL2CEf+wLwRcuX7YEVgAiVFXuADWras5Ztic=; b=iGTqRnwpDmdeHgH0jilMyJ9gseLWQzSrWmZXL72UZU3oakWNpbEQcqCzHEo8HiP37OTwu3 ukz/ur04qiFhyfbHQlEqp2gRhl7PZQyeUPvDnljivaP6GEvZuoJzFofemzVwqq1IBeFs+I ydSOXJEWVhxHdAkKvN9ivVx+p3LBJXPw1+KNdLjzDN5ILrotqjtK+HxZyOKiXUBDdgNFvP imZdDR8fJrqph8RbiVdvN4FKEsNvVKHJUXIuIM1p1sUJ1DVEwIMKJSDBdJj+amqGLkkPi9 C2AZdUwnTK9psj3UVcr+4tQ6LDTXR9RsopG1Da/x3gNEVuYeswRFG9/2iVvnDw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1635562697; a=rsa-sha256; cv=none; b=FRMq6dDKMZn2g+mtc3gzMxFJW5zItw2Ap3tEC8m6Q4z4KF7ENdWluq2I5C5Dt8O6YTJ9qs 7r7KS9i7YMTUgT/yD2X9s4vpQjBsk/pQx0/nSBsi2LP1d9rFUtjzeVRLIA82Q463MFcSvp eerBMuyn0QV0+GF6GzSxE6ZXuqD1+ExlkqXg8Y6i4zo3/ChIocDu+gVR+3vtCBPIANmIT5 9Xc9h5K52qdh1QVutCNhfPw8IeUHA0sRX1gYARnShycd9mNedbP1clYHklXY7rBwfhU0+E rUHrB/x1C9XJb3fOVL0DgSls73M695E7z9C9OIliR3YcbbdJNFazjKeaHuBlNw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b="LV/jvJpX"; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: 3.68 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b="LV/jvJpX"; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.net (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 27181116A0 X-Spam-Score: 3.68 X-Migadu-Scanner: scn0.migadu.com X-TUID: T+349uzE7NGi From: Sharlatan Hellseher This patch was co-authored with Vinicius Monego. * gnu/packages/astronomy.scm (python-astropy): New variable. --- gnu/packages/astronomy.scm | 95 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) diff --git a/gnu/packages/astronomy.scm b/gnu/packages/astronomy.scm index 95846749af..ec48c787e3 100644 --- a/gnu/packages/astronomy.scm +++ b/gnu/packages/astronomy.scm @@ -57,6 +57,7 @@ #:use-module (gnu packages version-control) #:use-module (gnu packages video) #:use-module (gnu packages xiph) + #:use-module (gnu packages xml) #:use-module (gnu packages xorg) #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) @@ -613,6 +614,100 @@ accurately in real time at any rate desired.") `(#:configure-flags '("-DENABLE_GTK=ON" "-DENABLE_QT=OFF") #:tests? #f)))) +(define-public python-astropy + (package + (name "python-astropy") + (version "4.3.1") + (source + (origin + (method url-fetch) + (uri (pypi-uri "astropy" version)) + (sha256 + (base32 "0lfd6n7v7kas4wvacddnwgccax3ks908735dzilg7dsf7ci52f9d")) + (modules '((guix build utils))) + (snippet + '(begin + ;; Remove Python bundles. + (with-directory-excursion "astropy/extern" + (for-each delete-file-recursively '("ply" "configobj"))) + ;; Remove cextern bundles and leave the wcslib bundle. Astropy + ;; upgrades to different versions of wcslib every few releases + ;; and tests break every upgrade. + ;; TODO: unbundle wcslib. + (with-directory-excursion "cextern" + (for-each delete-file-recursively '("cfitsio" "expat"))) + #t)))) + (build-system python-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'preparations + (lambda _ + ;; Use our own libraries in place of bundles, with the + ;; exception of wcslib. + (setenv "ASTROPY_USE_SYSTEM_CFITSIO" "1") + (setenv "ASTROPY_USE_SYSTEM_EXPAT" "1") + ;; Some tests require a writable home. + (setenv "HOME" "/tmp") + ;; Relax xfail tests. + (substitute* "setup.cfg" + (("xfail_strict = true") "xfail_strict = false")) + ;; Replace all references to external ply. + (let ((ply-files '("coordinates/angle_formats.py" + "utils/parsing.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"))) + (add-before 'check 'writable-compiler + (lambda _ (make-file-writable "astropy/_compiler.c"))) + (replace 'check + (lambda* (#:key inputs outputs tests? #:allow-other-keys) + (when tests? + (add-installed-pythonpath inputs outputs) + ;; Extensions have to be rebuilt before running the tests. + (invoke "python" "setup.py" "build_ext" "--inplace") + (invoke "python" "-m" "pytest" "--pyargs" "astropy" + ;; Skip tests that need remote data. + "-m" "not remote_data"))))))) + (native-inputs + `(("pkg-config" ,pkg-config) + ("python-coverage" ,python-coverage) + ("python-cython" ,python-cython) + ("python-extension-helpers" ,python-extension-helpers) + ("python-ipython" ,python-ipython) + ("python-jplephem" ,python-jplephem) + ("python-objgraph" ,python-objgraph) + ("python-pytest" ,python-pytest) + ("python-pytest-astropy" ,python-pytest-astropy) + ("python-pytest-xdist" ,python-pytest-xdist) + ("python-setuptools-scm" ,python-setuptools-scm) + ("python-sgp4" ,python-sgp4) + ("python-skyfield" ,python-skyfield))) + (inputs + `(("cfitsio" ,cfitsio) + ("expat" ,expat))) + (propagated-inputs + `(("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") + (description + "Astropy is a single core package for Astronomy in Python. It contains +much of the core functionality and some common tools needed for performing +astronomy and astrophysics.") + (license license:bsd-3))) + (define-public libnova (package (name "libnova") -- 2.30.2