[PATCH] New package: python-fire

  • Done
  • quality assurance status badge
Details
3 participants
  • Danial Behzadi
  • Maxime Devos
  • Raghav Gururajan
Owner
unassigned
Submitted by
Danial Behzadi
Severity
normal
D
D
Danial Behzadi wrote on 22 Jun 2021 15:33
(address . guix-patches@gnu.org)(name . Danial Behzadi)(address . dani.behzi@ubuntu.com)
20210622133326.346547-1-dani.behzi@ubuntu.com
---
gnu/packages/python-xyz.scm | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)

Toggle diff (50 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 1268ff257a..7ce0ada5ea 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -1410,6 +1410,43 @@ the version levels, and check whether any given string is a proper semantic
version identifier.")
(license license:bsd-3)))
+(define-public python-fire
+ (package
+ (name "python-fire")
+ (version "0.4.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "fire" version))
+ (sha256
+ (base32
+ "0qka44n88y3qcj7xz0k0f3qb4phcg4z0wvd4jcii9lcr6rvbiqn5"))))
+ (build-system python-build-system)
+ (native-inputs
+ `(("python-pytest", python-pytest)))
+ (arguments
+ '(#:phases
+ (modify-phases %standard-phases
+ (replace 'check
+ (lambda _ (invoke "pytest"))))))
+ (inputs
+ `(("python-six", python-six)
+ ("python-termcolor", python-termcolor)))
+ (synopsis "Library for automatically generating command line interfaces")
+ (description
+ "Python Fire is a library for automatically generating command line interfaces
+ (CLIs) from absolutely any Python object.
+
+ * Python Fire is a simple way to create a CLI in Python.
+ * Python Fire is a helpful tool for developing and debugging Python code.
+ * Python Fire helps with exploring existing code or turning other people's
+ code into a CLI.
+ * Python Fire makes transitioning between Bash and Python easier.
+ * Python Fire makes using a Python REPL easier by setting up the REPL with
+ the modules and variables you'll need already imported and created.")
+ (home-page "https://github.com/google/python-fire")
+ (license license:asl2.0)))
+
(define-public python2-semantic-version
(package-with-python2 python-semantic-version))
--
2.31.1
?
?
?????? ?????? wrote on 26 Jun 2021 15:19
(address . 49170@debbugs.gnu.org)
3DCAC3E7-4A69-44CF-8BCD-5706FEECAF49@ubuntu.com
Any news on this?
Should I do any additional step?
Attachment: file
?
?
?????? ?????? wrote on 26 Jun 2021 21:43
[PATCH v2]: gnu: Add python-fire
(address . 49170@debbugs.gnu.org)
BE5A2D12-223B-471D-996C-109980957380@ubuntu.com
Changed a little in LibreMiami packaging event
Attachment: file

?
?
?????? ?????? wrote on 26 Jun 2021 21:52
(address . 49170@debbugs.gnu.org)
6F62A6C8-CD81-49A0-BCC1-E1F733B31A61@ubuntu.com
Sorry. The previous one was malformed. This is the correct one.
Attachment: file
From d5bebceecb3e15313fadb59686303a4a46afa1ce Mon Sep 17 00:00:00 2001
From: Danial Behzadi <dani.behzi@ubuntu.com>
Date: Sat, 26 Jun 2021 15:28:49 -0400
Subject: [PATCH] gnu: Add python-fire.

* gnu/packages/python-xyz.scm (python-fire): New variable.
---
gnu/packages/python-xyz.scm | 41 +++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)

Toggle diff (61 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 6b92200beb..9d5065acd8 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -101,6 +101,9 @@
;;; Copyright © 2021 LibreMiami <packaging-guix@libremiami.org>
;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
+;;; Copyright © 2021 Danial Behzadi <dani.behzi@ubuntu.com>
+;;;
+;;; Copyright
;;;
;;; This file is part of GNU Guix.
;;;
@@ -220,6 +223,44 @@
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-26))
+(define-public python-fire
+ (package
+ (name "python-fire")
+ (version "0.4.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "fire" version))
+ (sha256
+ (base32
+ "0qka44n88y3qcj7xz0k0f3qb4phcg4z0wvd4jcii9lcr6rvbiqn5"))))
+ (build-system python-build-system)
+ (native-inputs
+ `(("python-pytest", python-pytest)))
+ (arguments
+ '(#:phases
+ (modify-phases %standard-phases
+ (replace 'check
+ (lambda _ (invoke "pytest"))))))
+ (inputs
+ `(("python-six", python-six)
+ ("python-termcolor", python-termcolor)))
+ (synopsis "Library for automatically generating command line interfaces")
+ (description
+ "Fire is a library for automatically generating command line interfaces
+from absolutely any Python object. The following are the advantages:
+@itemize
+@item A simple way to create a CLI in Python.
+@item A helpful tool for developing and debugging Python code.
+@item Helps with exploring existing code or turning other people's code into a
+command line interface.
+@item Makes transitioning between Bash and Python easier.
+@item Makes using a Python REPL easier by setting up the REPL with the modules
+and variables you'll need already imported and created.
+@end itemize")
+ (home-page "https://github.com/google/python-fire")
+ (license license:asl2.0)))
+
(define-public python-twodict
(package
(name "python-twodict")
--
2.32.0
R
R
Raghav Gururajan wrote on 26 Jun 2021 22:06
(no subject)
(address . 49170-done@debbugs.gnu.org)
d6251202-a7dc-0d1b-e9b6-2f2d671a2a66@raghavgururajan.name
Thank you for the contribution.

Pushed as 1f15a6559b.
Attachment: OpenPGP_signature
Closed
M
M
Maxime Devos wrote on 28 Jun 2021 23:30
Re: [bug#49170] [PATCH v2]: gnu: Add python-fire
(name . Raghav Gururajan)(address . rg@raghavgururajan.name)
ee84cadcf87dbf6de558e9c1b443110d900836a3.camel@telenet.be
Toggle quote (6 lines)
> + (arguments
> + '(#:phases
> + (modify-phases %standard-phases
> + (replace 'check
> + (lambda _ (invoke "pytest"))))))

I'm a bit late, as this has already been merged,
but this should have been something like:

Toggle quote (5 lines)
> + (replace 'check
> + (lambda* (#:key tests? #:allow-other-keys)
> + (when tests?
> + (invoke "pytest")))))))

That way, tests can be disabled with "--without-tests".
Try "./pre-inst-env guix build pytest --without-tests=pytests".
Respecting #:tests? can also be important for cross-compilation.

Could you send a follow-up patch, or could someone directly
commit such a change?

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYNo/hhccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7pa4AP9Brw5SXi0BhlzmgnE/9HMD+ih1
NPK5Z4Lu8E5ykFYT2gEAvEe60gnhxuJUNmU8RCGdM2lujXPDkFHS7cfWsYeKzw8=
=FuVB
-----END PGP SIGNATURE-----


R
R
Raghav Gururajan wrote on 28 Jun 2021 23:50
(name . Maxime Devos)(address . maximedevos@telenet.be)
9050ffe5-22a9-066b-7acd-428118d6e7b5@raghavgururajan.name
Hi Maxim!

Toggle quote (8 lines)
> I'm a bit late, as this has already been merged,
> but this should have been something like:
>
>> + (replace 'check
>> + (lambda* (#:key tests? #:allow-other-keys)
>> + (when tests?
>> + (invoke "pytest")))))))

Ah my bad to miss it. Thanks for catching it.

Toggle quote (7 lines)
> That way, tests can be disabled with "--without-tests".
> Try "./pre-inst-env guix build pytest --without-tests=pytests".
> Respecting #:tests? can also be important for cross-compilation.
>
> Could you send a follow-up patch, or could someone directly
> commit such a change?

I pushed as e61874a598.

Regards,
RG.
Attachment: OpenPGP_signature
?
?
?????? ?????? wrote on 28 Jun 2021 23:57
(name . Raghav Gururajan)(address . rg@raghavgururajan.name)
63CEA57F-D4D5-40E2-95A0-9F0EB0CEE806@ubuntu.com
This is awesome. I think Guix really lacks a very detailed document on packaging. Every patch I wrote is vastly based on apriority assumptions and lots of try and fails.

?? 28 ???? 2021 21:30:46 (UTC)? Maxime Devos <maximedevos@telenet.be> ????:
Toggle quote (23 lines)
>> + (arguments
>> + '(#:phases
>> + (modify-phases %standard-phases
>> + (replace 'check
>> + (lambda _ (invoke "pytest"))))))
>
>I'm a bit late, as this has already been merged,
>but this should have been something like:
>
>> + (replace 'check
>> + (lambda* (#:key tests? #:allow-other-keys)
>> + (when tests?
>> + (invoke "pytest")))))))
>
>That way, tests can be disabled with "--without-tests".
>Try "./pre-inst-env guix build pytest --without-tests=pytests".
>Respecting #:tests? can also be important for cross-compilation.
>
>Could you send a follow-up patch, or could someone directly
>commit such a change?
>
>Greetings,
>Maxime.
Attachment: file
M
M
Maxime Devos wrote on 29 Jun 2021 10:06
d08948faa80c9acdce48a225f2a011b5c51b3b32.camel@telenet.be
?????? ?????? schreef op ma 28-06-2021 om 21:57 [+0000]:
Toggle quote (3 lines)
> This is awesome. I think Guix really lacks a very detailed document on packaging.
> Every patch I wrote is vastly based on apriority assumptions and lots of try and fails.

Yes, not everything is in the manual.

FWIW, there should be a linter soonish verifying that #:tests? is respected:
'./pre-inst-env guix lint --no-network --exclude=derivation'
output ('derivation' is slow):

gnu/packages/astronomy.scm:898:5: python-jplephem@2.15: the 'check' phase should respect #:tests?
gnu/packages/astronomy.scm:690:5: missfits@2.8.0: sentences in description should be followed by two spaces; possible infraction at 268
gnu/packages/attr.scm:43:5: attr@2.4.48: the 'check' phase should respect #:tests?
gnu/packages/audio.scm:5208:5: ableton-link@3.0.2: the 'check' phase should respect #:tests?
gnu/packages/audio.scm:2484:2: audio-to-midi@2020.7: 'python-cython' should probably be a native input
gnu/packages/audio.scm:2488:6: audio-to-midi@2020.7: the source file name should contain the package name

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYNrUbBccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7uk9AQDVZ8k6sjgYQE0Iu8mCYw04ehIn
qu//tRrLNDSPKSiQRAEA3xgE4UWU8+Rj0+stbYJ8qrLsSHNBrN29393QA13c4wo=
=pPyv
-----END PGP SIGNATURE-----


?