~ruther/guix-local

3a81584342a141eae3ffb8aaad636cdff82acc88 — Sharlatan Hellseher 6 months ago 7b2c0c8
gnu: python-reproject: Clean up __pycache__ after tests.

* gnu/packages/astronomy.scm (python-reproject)[arguments] <test-flags>:
Remove unnecessary pytest options.  <phases>: Add 'post-check, removing
__pycache__ from output.

Change-Id: I9bcb571b597389db74f3ff5c3b90a6ca887deae7
1 files changed, 6 insertions(+), 4 deletions(-)

M gnu/packages/astronomy.scm
M gnu/packages/astronomy.scm => gnu/packages/astronomy.scm +6 -4
@@ 7643,7 7643,7 @@ PSF} describing how the optical system spreads light from sources.")
(define-public python-reproject
  (package
    (name "python-reproject")
    (version "0.14.1") ;XXX: Newer versions need to be build with NumPy 2+
    (version "0.14.1") ;XXX: Newer versions need to be built with NumPy 2+
    (source
     (origin
       (method url-fetch)


@@ 7658,19 7658,21 @@ PSF} describing how the optical system spreads light from sources.")
      #~(list "--arraydiff"
              "--arraydiff-default-format=fits"
              "--numprocesses" (number->string (min 8 (parallel-job-count)))
              "--pyargs" "reproject"
              ;; ValueError: Could not determine celestial frame corresponding
              ;; to the specified WCS object
              "-k" "not test_solar_wcs")
      #:phases
      #~(modify-phases %standard-phases
          ;; Use built library for tests.
          (replace 'check
            (lambda* (#:key tests? test-flags #:allow-other-keys)
              (when tests?
                (with-directory-excursion #$output
                  (setenv "HOME" "/tmp")
                  (apply invoke "pytest" "-vv" test-flags))))))))
                  (apply invoke "pytest" "-vv" test-flags)))))
          (add-before 'check 'post-check
            (lambda _
              (for-each delete-file-recursively
                        (find-files #$output "__pycache__" #:directories? #t)))))))
    (native-inputs
     (list python-cython
           python-extension-helpers