~ruther/guix-local

90101deabb3fa9d9334b2daee87b37625c9214dd — Sharlatan Hellseher 2 months ago 6cb925c
gnu: python-sncosmo: Adjust phases.

* gnu/packages/astronomy.scm (python-sncosmo):
[phases]{relax-requirements, prepare-test-environment}: Remove phases.
{pre-check}: New phase, do not re-build extension just remove local
source to reduce compute time.
[native-inputs]: Remove python-wheel; add python-iminuit and
python-pytest-xdist.

Change-Id: I3b8642b1a55a1563640b1a5306614f2cb9ec5c2a
Signed-off-by: Rutherther <rutherther@ditigal.xyz>
1 files changed, 27 insertions(+), 30 deletions(-)

M gnu/packages/astronomy.scm
M gnu/packages/astronomy.scm => gnu/packages/astronomy.scm +27 -30
@@ 8758,45 8758,42 @@ framework of lens modelling software lenstronomy.")
    (build-system pyproject-build-system)
    (arguments
     (list
      ;; tests: 83 passed, 4 skipped, 19 deselected
      #:test-flags
      #~(list
         ;; 23/27 tests fail requiring network access, ignore the whole file.
         "--ignore=sncosmo/tests/test_builtins.py"
         "-k" (string-join
               ;; Tests require network access.
               (list "not test_C11"
                     "test_G10"
                     "test_bandflux"
                     "test_bandflux_multi"
                     "test_bandflux_zpsys"
                     "test_bandfluxcov"
                     "test_bandmag"
                     "test_compositemagsystem_band_error"
                     "test_csp_magsystem"
                     "test_megacampsf_bandpass"
                     "test_salt2source_rcov_vs_snfit"
                     "test_salt2source_timeseries_vs_snfit"
                     "test_sugarsource"
                     "test_ztf_bandpass")
               " and not "))
      ;; Network access is required.
      #~(list "--ignore=tests/test_download_builtins.py"
              "--ignore=tests/test_builtins.py"
              "-k" (string-join
                    (list "not test_C11"
                          "test_G10"
                          "test_bandflux"
                          "test_bandflux_multi"
                          "test_bandflux_zpsys"
                          "test_bandfluxcov"
                          "test_bandmag"
                          "test_compositemagsystem_band_error"
                          "test_csp_magsystem"
                          "test_fit_lc_vs_snfit"
                          "test_megacampsf_bandpass"
                          "test_salt2source_rcov_vs_snfit"
                          "test_salt2source_timeseries_vs_snfit"
                          "test_sugarsource"
                          "test_ztf_bandpass")
                    " and not "))
      #:phases
      #~(modify-phases %standard-phases
         (add-after 'unpack 'relax-requirements
           (lambda _
             (substitute* "setup.cfg"
               ;; h5py>=3.11
               (("3.11") "3.8.0"))))
          (add-before 'check 'prepare-test-environment
          (add-before 'check 'pre-check
            (lambda _
              (setenv "HOME" "/tmp")
              (invoke "python" "setup.py" "build_ext" "--inplace"))))))
              (copy-recursively "sncosmo/tests" "tests")
              (delete-file-recursively "sncosmo" ))))))
    (native-inputs
     (list ;; python-iminuit ; not packed, optional
     (list python-iminuit
           python-cython
           python-pytest
           python-pytest-xdist
           python-pytest-astropy
           python-setuptools
           python-wheel))
           python-setuptools))
    (propagated-inputs
     (list python-astropy
           python-extinction