guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

03/08: gnu: python-photutils: Update package style.


From: guix-commits
Subject: 03/08: gnu: python-photutils: Update package style.
Date: Mon, 7 Aug 2023 14:17:46 -0400 (EDT)

andreas pushed a commit to branch master
in repository guix.

commit 8a88a7c0d9eb18920152671ef0f50d8d1d5171e3
Author: Sharlatan Hellseher <sharlatanus@gmail.com>
AuthorDate: Thu Jul 27 00:15:29 2023 +0100

    gnu: python-photutils: Update package style.
    
    * gnu/packages/astronomy.scm (python-photutils): Update package style.
    [build-system]: Swap to python-build-system.
    [arguments]: Use G-expressions. Rename the phase before check
    'writable-compiler to 'build-extensions to reflect its purpose, add
    new step in phase building extensions for testing.
    [native-inputs]: Remove python-pytest-runner.
    
    Signed-off-by: Andreas Enge <andreas@enge.fr>
---
 gnu/packages/astronomy.scm | 26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/gnu/packages/astronomy.scm b/gnu/packages/astronomy.scm
index b957e17350..791a739595 100644
--- a/gnu/packages/astronomy.scm
+++ b/gnu/packages/astronomy.scm
@@ -1918,23 +1918,29 @@ the easy construction of interactive matplotlib widget 
based animations.")
        (uri (pypi-uri "photutils" version))
        (sha256
         (base32 "1bq4ma402lpa5d6l85awlc23kasxf40nq8hgi3iyrilnfikan0jz"))))
-    (build-system python-build-system)
+    (build-system pyproject-build-system)
     (arguments
-     `(#:test-target "pytest"
-       #:phases
-       (modify-phases %standard-phases
-         ;; This file is opened in both install and check phases.
-         (add-before 'install 'writable-compiler
-           (lambda _ (make-file-writable "photutils/_compiler.c")))
-         (add-before 'check 'writable-compiler
-           (lambda _ (make-file-writable "photutils/_compiler.c"))))))
+     (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 "photutils/_compiler.c")))
+          (add-before 'check 'build-extensions
+            (lambda _
+              ;; Cython extensions have to be built before running
+              ;; the tests. If it's not build it fails with error:
+              ;;
+              ;; ModuleNotFoundError: No module named
+              ;; 'photutils.geometry.circular_overlap'
+              (make-file-writable "photutils/_compiler.c")
+              (invoke "python" "setup.py" "build_ext" "--inplace"))))))
     (propagated-inputs
      (list python-astropy python-numpy))
     (native-inputs
      (list python-cython
            python-extension-helpers
            python-pytest-astropy
-           python-pytest-runner
            python-setuptools-scm))
     (home-page "https://github.com/astropy/photutils";)
     (synopsis "Source detection and photometry")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]