~ruther/guix-local

e640aa6acb7c92c5da3cf55c35005aa7def08b47 — Nicolas Graves 4 months ago 95d9fd2
gnu: python-petsc4py: Switch to pyproject.

* gnu/packages/maths.scm (python-petsc4py): Run guix style.
[build-system]: Switch to pyproject-build-system.
[native-inputs]: Add python-setuptools.

Change-Id: If00fb947d8d0b99665601c04714d5b7d21fb167f
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
1 files changed, 20 insertions(+), 21 deletions(-)

M gnu/packages/maths.scm
M gnu/packages/maths.scm => gnu/packages/maths.scm +20 -21
@@ 4663,28 4663,27 @@ can return results in exact arithmetic.")
    (name "python-petsc4py")
    (version "3.24.0")
    (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "petsc4py" version))
        (sha256
          (base32
           "06wi2r43drlfj3hml5392pckn2n99rjfb1p1hz75n3d84z5jrj9x"))))
    (build-system python-build-system)
     (origin
       (method url-fetch)
       (uri (pypi-uri "petsc4py" version))
       (sha256
        (base32 "06wi2r43drlfj3hml5392pckn2n99rjfb1p1hz75n3d84z5jrj9x"))))
    (build-system pyproject-build-system)
    (arguments
     (list #:phases
           #~(modify-phases %standard-phases
               (add-before 'build 'set-PETSC_DIR
                 (lambda* (#:key inputs #:allow-other-keys)
                   ;; Define path to PETSc installation.
                   (setenv "PETSC_DIR"
                           (assoc-ref inputs "petsc-openmpi"))))
               (add-before 'check 'mpi-setup
                 #$%openmpi-setup)
               (replace 'check
                 (lambda* (#:key tests? #:allow-other-keys)
                   (when tests?
                     (invoke "python" "test/runtests.py")))))))
    (native-inputs (list python-cython))
     (list
      #:phases
      #~(modify-phases %standard-phases
          (add-before 'build 'set-PETSC_DIR
            (lambda* (#:key inputs #:allow-other-keys)
              ;; Define path to PETSc installation.
              (setenv "PETSC_DIR"
                      (assoc-ref inputs "petsc-openmpi"))))
          (add-before 'check 'mpi-setup #$%openmpi-setup)
          (replace 'check
            (lambda* (#:key tests? #:allow-other-keys)
              (when tests?
                (invoke "python" "test/runtests.py")))))))
    (native-inputs (list python-cython python-setuptools))
    (inputs (list petsc-openmpi python-numpy))
    (home-page "https://bitbucket.org/petsc/petsc4py/")
    (synopsis "Python bindings for PETSc")