Subject: [bug#76480] [PATCH 10/51] gnu: python-astropy-healpix: Update to 1.1.2.

From: Sharlatan Hellseher <[email-masked]>
Date: Fri, 21 Feb 2025 21:49:04 +0000

* gnu/packages/astronomy.scm (python-astropy-healpix): Update to 1.1.2.
[arguments] <phases>: Remove 'writable-compiler
'prepare-test-environment and use custom 'check; add
'relax-requirements.
[native-inputs]: Add python-setuptools.

Change-Id: If8705cb47dc1f2f15b11e31b1c08688c9b991ebe
---
 gnu/packages/astronomy.scm | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/astronomy.scm b/gnu/packages/astronomy.scm
index d75c20f0d1e..db3500c2910 100644
--- a/gnu/packages/astronomy.scm
+++ b/gnu/packages/astronomy.scm
@@ -3801,30 +3801,33 @@ (define-public python-astropy-minimal
 (define-public python-astropy-healpix
   (package
     (name "python-astropy-healpix")
-    (version "1.0.3")
+    (version "1.1.2")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "astropy_healpix" version))
        (sha256
-        (base32 "0ilpwwvdnd4nchivwnbiy1hl07hd2mdg4wb90r2p05kvr5z2lpfy"))))
+        (base32 "1r362081aj5jqxshcxw0bpzn4qvqnra52k94ghskpv1n5bqisrq3"))))
     (build-system pyproject-build-system)
     (arguments
      (list
       #:phases
       #~(modify-phases %standard-phases
-          ;; This file is opened in both install and check phases.
-          (add-before 'install 'writable-compiler
-            (lambda _ (make-file-writable "astropy_healpix/_compiler.c")))
-          (add-before 'check 'prepare-test-environment
+          (add-after 'unpack 'relax-requirements
             (lambda _
-              ;; Extensions have to be rebuilt before running the tests.
-              (invoke "python" "setup.py" "build_ext" "--inplace")
-              (make-file-writable "astropy_healpix/_compiler.c"))))))
+              (substitute* "setup.cfg"
+                ;; numpy>=1.25
+                ((">=1.25") ">=1.24"))))
+          (replace 'check
+            (lambda* (#:key tests? test-flags #:allow-other-keys)
+              (when tests?
+                (with-directory-excursion #$output
+                  (apply invoke "pytest" "-vv" test-flags))))))))
     (native-inputs
      (list python-extension-helpers
            python-hypothesis
            python-pytest-astropy
+           python-setuptools
            python-setuptools-scm
            python-wheel))
     (propagated-inputs
-- 
2.47.1