~ruther/guix-local

f690a8b0bf6a52e7cb553139a5442c25ee20230c — Sharlatan Hellseher 3 months ago 3a81584
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
1 files changed, 12 insertions(+), 19 deletions(-)

M gnu/packages/astronomy.scm
M gnu/packages/astronomy.scm => gnu/packages/astronomy.scm +12 -19
@@ 6967,32 6967,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