diff mbox series

[bug#57101] gnu: python-typer: Update to 0.6.1.

Message ID 20220810081253.7008-1-tanguy@bioneland.org
State Accepted
Headers show
Series [bug#57101] gnu: python-typer: Update to 0.6.1. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git-branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Tanguy LE CARROUR Aug. 10, 2022, 8:12 a.m. UTC
* gnu/packages/python-xyz.scm (python-typer): Update to 0.6.1.
[source]: Use GIT-FETCH.
[arguments]: Build from source with flit.
[native-inputs]: Add python-flit and python-rich.
---
 gnu/packages/python-xyz.scm | 28 +++++++++++++++++++++-------
 1 file changed, 21 insertions(+), 7 deletions(-)

Comments

Mathieu Othacehe Aug. 12, 2022, 8:38 a.m. UTC | #1
> * gnu/packages/python-xyz.scm (python-typer): Update to 0.6.1.
> [source]: Use GIT-FETCH.
> [arguments]: Build from source with flit.
> [native-inputs]: Add python-flit and python-rich.

Pushed, thanks! I also introduced gexps as a follow-up.

Mathieu
Tanguy LE CARROUR Aug. 12, 2022, 9:09 a.m. UTC | #2
Hi Mathieu,


Quoting Mathieu Othacehe (2022-08-12 10:38:21)
> 
> > * gnu/packages/python-xyz.scm (python-typer): Update to 0.6.1.
> > [source]: Use GIT-FETCH.
> > [arguments]: Build from source with flit.
> > [native-inputs]: Add python-flit and python-rich.
> 
> Pushed, thanks! I also introduced gexps as a follow-up.

Thanks!
diff mbox series

Patch

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index d18959889e..196659417c 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -21437,15 +21437,16 @@  (define-public python-typed-ast
 (define-public python-typer
   (package
     (name "python-typer")
-    (version "0.3.2")
+    (version "0.6.1")
     (source
      (origin
-       ;; Building `python-typer` from the git repository requires the `flit-core`
-       ;; Python package that is not installed by `python-flit`.
-       (method url-fetch)
-       (uri (pypi-uri "typer" version))
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/tiangolo/typer")
+             (commit version)))
+       (file-name (git-file-name name version))
        (sha256
-        (base32 "00v3h63dq8yxahp9vg3yb9r27l2niwv8gv0dbds9dzrc298dfmal"))))
+        (base32 "1knv353qhkl2imav3jfp6bgq47m8wkkqhq1dzmqg2sv8rsy7zgl7"))))
     (build-system python-build-system)
     (arguments
      `(#:phases
@@ -21457,6 +21458,18 @@  (define-public python-typer
              (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)
+             (let ((out (assoc-ref outputs "out")))
+               (for-each (lambda (wheel)
+                           (format #true wheel)
+                           (invoke "python" "-m" "pip" "install"
+                                   wheel (string-append "--prefix=" out)))
+                         (find-files "dist" "\\.whl$")))))
          (replace 'check
            (lambda* (#:key tests? #:allow-other-keys)
              (when tests?
@@ -21478,7 +21491,8 @@  (define-public python-typer
     (propagated-inputs
      (list python-click))
     (native-inputs
-     (list python-coverage python-pytest python-shellingham))
+     (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")