[PATCH] gnu: Add python-tldr.

  • Done
  • quality assurance status badge
Details
3 participants
  • Efraim Flashner
  • Vinicius Monego
  • Tanguy Le Carrour
Owner
unassigned
Submitted by
Tanguy Le Carrour
Severity
normal
T
T
Tanguy Le Carrour wrote on 18 Feb 2021 15:06
(address . guix-patches@gnu.org)(name . Tanguy Le Carrour)(address . tanguy@bioneland.org)
20210218140620.15816-1-tanguy@bioneland.org
* gnu/packages/python-xyz.scm (python-tldr): New variable.
---
gnu/packages/python-xyz.scm | 28 +++++++++++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)

Toggle diff (48 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index a504bb521b..b315d5f634 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -66,7 +66,7 @@
;;; Copyright © 2019 Jacob MacDonald <jaccarmac@gmail.com>
;;; Copyright © 2019, 2020 Giacomo Leidi <goodoldpaul@autistici.org>
;;; Copyright © 2019 Wiktor ?elazny <wzelazny@vurv.cz>
-;;; Copyright © 2019, 2020 Tanguy Le Carrour <tanguy@bioneland.org>
+;;; Copyright © 2019, 2020, 2021 Tanguy Le Carrour <tanguy@bioneland.org>
;;; Copyright © 2019 M?d?lin Ionel Patra?cu <madalinionel.patrascu@mdc-berlin.de>
;;; Copyright © 2020 Riku Viitanen <riku.viitanen@protonmail.com>
;;; Copyright © 2020 Jakub K?dzio?ka <kuba@kadziolka.net>
@@ -19267,6 +19267,32 @@ Public Suffix List's private domains as well.")
(define-public python2-tldextract
(package-with-python2 python-tldextract))
+(define-public python-tldr
+ (package
+ (name "python-tldr")
+ (version "1.2.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "tldr" version))
+ (sha256
+ (base32
+ "00h43xjrzrayy1gysvmql5kfabk2d8xraih68d41616brdvb1xvf"))))
+ (build-system python-build-system)
+ (native-inputs
+ `(("python-pytest" ,python-pytest)
+ ("python-pytest-runner" ,python-pytest-runner)))
+ (propagated-inputs
+ `(("python-argcomplete" ,python-argcomplete)
+ ("python-colorama" ,python-colorama)
+ ("python-termcolor" ,python-termcolor)))
+ (home-page "https://github.com/tldr-pages/tldr-python-client")
+ (synopsis "Python command-line client for tldr pages")
+ (description "This package provides the `tldr' command allowing users
+to view `tldr' pages from a shell. The `tldr' pages are a community effort
+to simplify the man pages with practical examples.")
+ (license license:expat))) ; MIT license
+
(define-public python-nodeenv
(package
(name "python-nodeenv")
--
2.30.0
V
V
Vinicius Monego wrote on 23 May 2021 23:15
(name . Tanguy Le Carrour)(address . tanguy@bioneland.org)(address . 46616@debbugs.gnu.org)
05b49dc60b6a7c24ffd269293b9f9536abda14f2.camel@posteo.net
Hi,

Em qui, 2021-02-18 às 15:06 +0100, Tanguy Le Carrour escreveu:
Toggle quote (4 lines)
> * gnu/packages/python-xyz.scm (python-tldr): New variable.
> ---
>  gnu/packages/python-xyz.scm | 28 +++++++++++++++++++++++++++-

[...]

Toggle quote (4 lines)
> +(define-public python-tldr
> +  (package
> +    (name "python-tldr")

I noticed that this program is a command line tool. It should be named
'tldr' only and be moved to another file. Perhaps to man.scm?

Toggle quote (12 lines)
> +    (source
> +      (origin
> +        (method url-fetch)
> +        (uri (pypi-uri "tldr" version))
> +        (sha256
> +         (base32
> +          "00h43xjrzrayy1gysvmql5kfabk2d8xraih68d41616brdvb1xvf"))))
> +    (build-system python-build-system)
> +    (native-inputs
> +     `(("python-pytest" ,python-pytest)
> +       ("python-pytest-runner" ,python-pytest-runner)))

The tests for this one are not distributed in the PyPI release. Could
you source from the homepage instead?

There is one test that tries to open a network connection, it will have
to be skipped.

Toggle quote (5 lines)
> +    (propagated-inputs
> +     `(("python-argcomplete" ,python-argcomplete)
> +       ("python-colorama" ,python-colorama)
> +       ("python-termcolor" ,python-termcolor)))

If it is only a command line tool, inputs should be normal inputs here.

Toggle quote (6 lines)
> +    (description "This package provides the `tldr' command allowing
> users
> +to view `tldr' pages from a shell.  The `tldr' pages are a community
> effort
> +to simplify the man pages with practical examples.")

The linter made this complaint for the description: "use @code or
similar ornament instead of quotes".

LGTM otherwise.

Could you make these changes and send a v2 with version 1.2.1?

Vinicius
T
T
Tanguy LE CARROUR wrote on 6 Jun 2021 16:14
(name . Vinicius Monego)(address . monego@posteo.net)(address . 46616@debbugs.gnu.org)
1622988617.5jhzwoy3iq.astroid@melmoth.none
Hi Vinicius,

Thanks for reviewing this patch, and sorry for the late answer!


Excerpts from Vinicius Monego's message of May 23, 2021 11:15 pm:
Toggle quote (14 lines)
> Em qui, 2021-02-18 às 15:06 +0100, Tanguy Le Carrour escreveu:
>> * gnu/packages/python-xyz.scm (python-tldr): New variable.
>> ---
>>  gnu/packages/python-xyz.scm | 28 +++++++++++++++++++++++++++-
>
> [...]
>
>> +(define-public python-tldr
>> +  (package
>> +    (name "python-tldr")
>
> I noticed that this program is a command line tool. It should be named
> 'tldr' only and be moved to another file. Perhaps to man.scm?

Your suggestions make sense, but there's another `tldr` client.
Namely `ghc-tldr`. It's defined in `gnu/packages/haskell-xyz.scm`.
If it's okay with you, I'll leave `python-tldr` in `gnu/packages/python-xyz.scm`.


Toggle quote (18 lines)
>> +    (source
>> +      (origin
>> +        (method url-fetch)
>> +        (uri (pypi-uri "tldr" version))
>> +        (sha256
>> +         (base32
>> +          "00h43xjrzrayy1gysvmql5kfabk2d8xraih68d41616brdvb1xvf"))))
>> +    (build-system python-build-system)
>> +    (native-inputs
>> +     `(("python-pytest" ,python-pytest)
>> +       ("python-pytest-runner" ,python-pytest-runner)))
>
> The tests for this one are not distributed in the PyPI release. Could
> you source from the homepage instead?
>
> There is one test that tries to open a network connection, it will have
> to be skipped.

Done.


Toggle quote (8 lines)
>
>> +    (propagated-inputs
>> +     `(("python-argcomplete" ,python-argcomplete)
>> +       ("python-colorama" ,python-colorama)
>> +       ("python-termcolor" ,python-termcolor)))
>
> If it is only a command line tool, inputs should be normal inputs here.

Done.


Toggle quote (9 lines)
>> +    (description "This package provides the `tldr' command allowing
>> users
>> +to view `tldr' pages from a shell.  The `tldr' pages are a community
>> effort
>> +to simplify the man pages with practical examples.")
>
> The linter made this complaint for the description: "use @code or
> similar ornament instead of quotes".

Done.


The new patch is following in another email…

Regards,

--
Tanguy
T
T
Tanguy Le Carrour wrote on 6 Jun 2021 16:16
[PATCH v2] gnu: Add python-tldr.
(address . 46616@debbugs.gnu.org)
20210606141634.19796-1-tanguy@bioneland.org
* gnu/packages/python-xyz.scm (python-tldr): New variable.
---
gnu/packages/python-xyz.scm | 38 ++++++++++++++++++++++++++++++++++++-
1 file changed, 37 insertions(+), 1 deletion(-)

Toggle diff (58 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index a4fe31a01f..bc8c2133f5 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -66,7 +66,7 @@
;;; Copyright © 2019 Jacob MacDonald <jaccarmac@gmail.com>
;;; Copyright © 2019, 2020 Giacomo Leidi <goodoldpaul@autistici.org>
;;; Copyright © 2019 Wiktor ?elazny <wzelazny@vurv.cz>
-;;; Copyright © 2019, 2020 Tanguy Le Carrour <tanguy@bioneland.org>
+;;; Copyright © 2019, 2020, 2021 Tanguy Le Carrour <tanguy@bioneland.org>
;;; Copyright © 2019, 2021 M?d?lin Ionel Patra?cu <madalinionel.patrascu@mdc-berlin.de>
;;; Copyright © 2020 Riku Viitanen <riku.viitanen@protonmail.com>
;;; Copyright © 2020 Jakub K?dzio?ka <kuba@kadziolka.net>
@@ -20825,6 +20825,42 @@ Public Suffix List's private domains as well.")
(define-public python2-tldextract
(package-with-python2 python-tldextract))
+(define-public python-tldr
+ (package
+ (name "python-tldr")
+ (version "1.2.1")
+ (source
+ (origin
+ ;; There's no test in PyPI.
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/tldr-pages/tldr-python-client")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0n9wqvjxspm18vlxf9j9slrcydshk4rkv5nwkrqhfq606n6zvks4"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (replace 'check
+ (lambda _
+ ;; This test fails. It tries to open a network socket.
+ (invoke "pytest" "-vv" "-k" "not test_error_message"))))))
+ (native-inputs
+ `(("python-pytest" ,python-pytest)
+ ("python-pytest-runner" ,python-pytest-runner)))
+ (inputs
+ `(("python-argcomplete" ,python-argcomplete)
+ ("python-colorama" ,python-colorama)
+ ("python-termcolor" ,python-termcolor)))
+ (home-page "https://github.com/tldr-pages/tldr-python-client")
+ (synopsis "Python command-line client for tldr pages")
+ (description "This package provides the @code{tldr} command allowing users
+to view @code{tldr} pages from a shell. The `tldr' pages are a community effort
+to simplify the man pages with practical examples.")
+ (license license:expat))) ; MIT license
+
(define-public python-nodeenv
(package
(name "python-nodeenv")
--
2.31.1
E
E
Efraim Flashner wrote on 20 Jul 2021 21:12
(name . Tanguy Le Carrour)(address . tanguy@bioneland.org)
YPcgCOoMN84gzLMK@3900XT
Thanks. I changed the 'check phase so that the tests can be skipped if
desired.

Patch pushed!

--
Efraim Flashner <efraim@flashner.co.il> ????? ?????
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmD3IAgACgkQQarn3Mo9
g1HBSBAAvwdt2riudpVvwFRAkB0UFi+iGuxpqpMlvdBEZN4My1DZV7FDEpkQSHHw
kkPf5+DUgOv7coTbqlLZW4UCyjKnhToaS6evAC/tcyLjak49s67J5qe/9B4Yzq7D
VtYNtNeehfq2gEE+XykgT2aSBRKzExkBchKerVenW4cxs7gGlE1LTyD9MJV4gY4C
g1vP4V/BlHtbm9yuRS07DjJdZNeTJ2Wo58ZIFfP2gIilJPmxs/VR6wTS4ScyVDGS
WyrRwlNU9uBFVKT2xsj4XjAiSQB5eEn2r1n6yIhV6RVpkdJvIkqVNZ8Wr/U6cMqB
u1LQxsgrLw+OSo07obBugmsGbA7P3BwCiXGbbs4XWyPVMWeurQgfeafzV1FUTTOu
0t5PsCd0narbkz3cQG7qgWI8yFg2XMbzzohzVpErkSZu56iHEjG26UxB1nigyLBN
EfH9Gi8jBfTg+h7QNccgVfMH4RZeUZ94ZPIz8L/A/3SHw2m3GuG8w7XMqlJWtwM+
yES1XXac723Dz4DCIaFcs47Zw4kJgSYN/XUvrqyw+2RZkEZqHoRZ5ZI0fyz4LUtG
eQXs3HfEIeRrrgtTjCJW0h+IdNf6cwW4frHr2blbK/yyWE0yznfc3WAEGwEbF36U
5Y5nZ3VIAQ9vb657TZDRR12iULH8EIP/tqLAZeN9FYoS8zJaNtM=
=+Do8
-----END PGP SIGNATURE-----


Closed
T
T
Tanguy LE CARROUR wrote on 21 Jul 2021 08:10
(name . Efraim Flashner)(address . efraim@flashner.co.il)
1626847781.nyobv984b0.astroid@melmoth.none
Excerpts from Efraim Flashner's message of July 20, 2021 9:12 pm:
Toggle quote (5 lines)
> Thanks. I changed the 'check phase so that the tests can be skipped if
> desired.
>
> Patch pushed!

Thanks!

Best regards,

--
Tanguy
Closed
?