andreas pushed a commit to branch python-team
in repository guix.

commit 239c9d829d6360d8c58ce84a66054cd09617d67e
Author: Nicolas Graves <[email protected]>
AuthorDate: Sun Apr 6 14:37:21 2025 +0200

    gnu: bpytop: Switch to pyproject-build-system.
    
    * gnu/packages/admin.scm (bpytop)
    [build-system]: Switch to pyproject.
    [arguments]{tests?}: Disable tests.
    {phases}: Add phase 'use-poetry-core. Improve phase 'install-theme.
    [native-inputs]: Add python-poetry-core.
    
    Change-Id: Ib671bb71c3f920b9e134554628b16a8e8968500b
    Signed-off-by: Steve George <[email protected]>
---
 gnu/packages/admin.scm | 38 +++++++++++++++++++++-----------------
 1 file changed, 21 insertions(+), 17 deletions(-)

diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index 9fe6f63c66..5eeb15090a 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -1065,25 +1065,29 @@ memory, disks, network and processes.")
        (uri (pypi-uri "bpytop" version))
        (sha256
         (base32 "1clvajbv7pzlya9s1xs6dvjic8rv3kx7aqiwnjxapiypx246gdjk"))))
-    (build-system python-build-system)
+    (build-system pyproject-build-system)
+    (arguments
+     (list
+      #:tests? #f ; No tests in Pypi archive.
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'use-poetry-core
+            (lambda _
+              ;; Patch to use the core poetry API.
+              (substitute* "pyproject.toml"
+                (("poetry.masonry.api")
+                 "poetry.core.masonry.api"))))
+          (add-after 'install 'install-themes
+            (lambda* (#:key inputs outputs #:allow-other-keys)
+              (let ((themes (string-append (site-packages inputs outputs)
+                                           "/bpytop-themes")))
+                (mkdir-p themes)
+                (copy-recursively "themes" themes)))))))
     (inputs
      (list python-psutil))
-    (arguments
-     `(#:phases
-       (modify-phases %standard-phases
-         ;; sanity-check phase fail, but the application seems to be working
-         (delete 'sanity-check)
-         (add-after 'install 'install-themes
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let ((themes (string-append (assoc-ref outputs "out")
-                                          "/lib/python"
-                                          ,(version-major+minor
-                                            (package-version python))
-                                          "/site-packages/bpytop-themes")))
-               (mkdir-p themes)
-               (copy-recursively "themes" themes)))))))
-    (home-page
-     "https://github.com/aristocratos/bpytop";)
+    (native-inputs
+     (list python-poetry-core))
+    (home-page "https://github.com/aristocratos/bpytop";)
     (synopsis "Resource monitor")
     (description "Resource monitor that shows usage and stats for processor,
 memory, disks, network and processes.  It's a Python port and continuation of

Reply via email to