guix_mirror_bot pushed a commit to branch astro-updates
in repository guix.

commit 03ab6a9ba659c53891e8ea0949d3ccfc4d940157
Author: Sharlatan Hellseher <[email protected]>
AuthorDate: Thu Nov 13 19:45:19 2025 +0000

    gnu: python-pyregion: Simplify and improve package.
    
    * gnu/packages/astronomy.scm (python-pyregion)[arguments] <phases>:
    Remove 'create-setup.py, and 'build-extension; use custom 'check; add
    'post-check.
    [native-inputs]: Remove python-pytest-astropy-header and python-wheel.
    
    Change-Id: Id36c316c4ad54cea34df4224ef8f66dad282cbb2
---
 gnu/packages/astronomy.scm | 31 ++++++++++++-------------------
 1 file changed, 12 insertions(+), 19 deletions(-)

diff --git a/gnu/packages/astronomy.scm b/gnu/packages/astronomy.scm
index 9b26075b95..3ad1b9c1b5 100644
--- a/gnu/packages/astronomy.scm
+++ b/gnu/packages/astronomy.scm
@@ -7194,32 +7194,25 @@ N-Chilada and RAMSES AMR outputs.")
      (list
       #:phases
       #~(modify-phases %standard-phases
-          ;; setup.py was removed in b26ec4fe88e29447dc8391fcdef7082a4f7876ce
-          ;; TODO: Check how to implement it in python-build-system.
-          (add-after 'unpack 'create-setup.py
-            (lambda _
-              (call-with-output-file "setup.py"
-                (lambda (port)
-                  (format port "from setuptools import setup
-from extension_helpers import get_extensions
-setup(ext_modules=get_extensions())")))))
-          (add-before 'check 'build-extensions
+          (replace 'check
+            (lambda* (#:key tests? test-flags #:allow-other-keys)
+              (with-directory-excursion #$output
+                (apply invoke "pytest" "-vv" test-flags))))
+          (add-before 'check 'post-check
             (lambda _
-              ;; Cython extensions have to be built before running the tests.
-              (invoke "python" "setup.py" "build_ext" "--inplace"))))))
-    (propagated-inputs
-     (list python-astropy
-           python-numpy
-           python-pyparsing))
+              (for-each delete-file-recursively
+                        (find-files #$output "__pycache__" #:directories? 
#t)))))))
     (native-inputs
      (list python-cython
            python-extension-helpers
            python-pytest
            python-pytest-astropy
-           python-pytest-astropy-header
            python-setuptools
-           python-setuptools-scm
-           python-wheel))
+           python-setuptools-scm))
+    (propagated-inputs
+     (list python-astropy
+           python-numpy
+           python-pyparsing))
     (home-page "https://github.com/astropy/pyregion";)
     (synopsis "Python parser for ds9 region files")
     (description

Reply via email to