guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/04: gnu: python-typer: Simplify by using pyproject-build-system.


From: guix-commits
Subject: 01/04: gnu: python-typer: Simplify by using pyproject-build-system.
Date: Mon, 12 Dec 2022 18:01:00 -0500 (EST)

rekado pushed a commit to branch master
in repository guix.

commit c4bcb5db49b210097c5452b678e57a0774014814
Author: Ricardo Wurmus <rekado@elephly.net>
AuthorDate: Mon Dec 12 21:40:53 2022 +0100

    gnu: python-typer: Simplify by using pyproject-build-system.
    
    * gnu/packages/python-xyz.scm (python-typer)[build-system]: Use
    pyproject-build-system.
    [arguments]: Remove extra quoting; remove custom 'build phase; remove custom
    'install phase; remove custom 'check phase; add 'pre-check phase.
    [synopsis]: Pull onto the same line.
    [description]: Reformat.
---
 gnu/packages/python-xyz.scm | 74 +++++++++++++++++----------------------------
 1 file changed, 28 insertions(+), 46 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 9629012a80..bb25c35caf 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -22311,60 +22311,42 @@ based on the CPython 2.7 and 3.7 parsers.")
        (file-name (git-file-name name version))
        (sha256
         (base32 "1knv353qhkl2imav3jfp6bgq47m8wkkqhq1dzmqg2sv8rsy7zgl7"))))
-    (build-system python-build-system)
+    (build-system pyproject-build-system)
     (arguments
-     `(#:phases
-       ,#~(modify-phases %standard-phases
-            ;; Unfortunately, this doesn't seem to be enough to fix these two
-            ;; tests, but we'll patch this anyway.
-            (add-after 'unpack 'patch-shell-reference
-              (lambda _
-                (substitute* "tests/test_completion/test_completion.py"
-                  (("\"bash\"") (string-append "\"" (which "bash") "\""))
-                  (("\"/bin/bash\"")
-                   (string-append "\"" (which "bash") "\"")))))
-            (replace 'build
-              (lambda _
-                (invoke "flit" "build")))
-            (replace 'install
-              (lambda* (#:key inputs outputs #:allow-other-keys)
-                (add-installed-pythonpath inputs outputs)
-                (for-each
-                 (lambda (wheel)
-                   (format #true wheel)
-                   (invoke "python" "-m" "pip" "install"
-                           wheel (string-append "--prefix=" #$output)))
-                 (find-files "dist" "\\.whl$"))))
-            (replace 'check
-              (lambda* (#:key tests? #:allow-other-keys)
-                (when tests?
-                  (setenv "HOME" "/tmp") ; some tests need it
-
-                  ;; This is for completion tests
-                  (with-output-to-file "/tmp/.bashrc"
-                    (lambda _ (display "# dummy")))
-
-                  (setenv "GUIX_PYTHONPATH"
-                          (string-append (getcwd) ":"
-                                         (getenv "GUIX_PYTHONPATH")))
-                  (let ((disabled-tests (list "test_show_completion"
-                                              "test_install_completion")))
-                    (invoke "python" "-m" "pytest" "tests/"
-                            "-k"
-                            (string-append "not "
-                                           (string-join disabled-tests
-                                                        " and not "))))))))))
+     (list
+      #:test-flags
+      '(let ((disabled-tests (list "test_show_completion"
+                                   "test_install_completion")))
+         (list "-k" (string-append "not "
+                                   (string-join disabled-tests
+                                                " and not "))))
+      #:phases
+      #~(modify-phases %standard-phases
+          ;; Unfortunately, this doesn't seem to be enough to fix these two
+          ;; tests, but we'll patch this anyway.
+          (add-after 'unpack 'patch-shell-reference
+            (lambda _
+              (substitute* "tests/test_completion/test_completion.py"
+                (("\"bash\"") (string-append "\"" (which "bash") "\""))
+                (("\"/bin/bash\"")
+                 (string-append "\"" (which "bash") "\"")))))
+          (add-before 'check 'pre-check
+            (lambda* (#:key tests? #:allow-other-keys)
+              (when tests?
+                (setenv "HOME" "/tmp")  ; some tests need it
+                ;; This is for completion tests
+                (with-output-to-file "/tmp/.bashrc"
+                  (lambda _ (display "# dummy")))))))))
     (propagated-inputs
      (list python-click))
     (native-inputs
      (list python-coverage python-flit python-pytest python-rich
            python-shellingham))
     (home-page "https://github.com/tiangolo/typer";)
-    (synopsis
-     "Typer builds CLI based on Python type hints")
+    (synopsis "Typer builds CLI based on Python type hints")
     (description
-     "Typer is a library for building CLI applications.  It's based on
-Python 3.6+ type hints.")
+     "Typer is a library for building CLI applications.  It's based on Python
+3.6+ type hints.")
     ;; MIT license
     (license license:expat)))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]