unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#49170] [PATCH] New package: python-fire
@ 2021-06-22 13:33 Danial Behzadi
  2021-06-26 13:19 ` دانیال بهزادی
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Danial Behzadi @ 2021-06-22 13:33 UTC (permalink / raw)
  To: 49170; +Cc: Danial Behzadi

---
 gnu/packages/python-xyz.scm | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

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





^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [bug#49170] [PATCH] New package: python-fire
  2021-06-22 13:33 [bug#49170] [PATCH] New package: python-fire Danial Behzadi
@ 2021-06-26 13:19 ` دانیال بهزادی
  2021-06-26 19:43 ` [bug#49170] [PATCH v2]: gnu: Add python-fire دانیال بهزادی
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: دانیال بهزادی @ 2021-06-26 13:19 UTC (permalink / raw)
  To: 49170

[-- Attachment #1: Type: text/plain, Size: 51 bytes --]

Any news on this?
Should I do any additional step?

[-- Attachment #2: Type: text/html, Size: 94 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#49170] [PATCH v2]: gnu: Add python-fire
  2021-06-22 13:33 [bug#49170] [PATCH] New package: python-fire Danial Behzadi
  2021-06-26 13:19 ` دانیال بهزادی
@ 2021-06-26 19:43 ` دانیال بهزادی
  2021-06-26 19:52 ` دانیال بهزادی
  2021-06-26 20:06 ` bug#49170: (no subject) Raghav Gururajan via Guix-patches via
  3 siblings, 0 replies; 9+ messages in thread
From: دانیال بهزادی @ 2021-06-26 19:43 UTC (permalink / raw)
  To: 49170


[-- Attachment #1.1: Type: text/plain, Size: 46 bytes --]

Changed a little in LibreMiami packaging event

[-- Attachment #1.2: Type: text/html, Size: 87 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-python-fire.patch --]
[-- Type: text/x-diff; name=0001-gnu-Add-python-fire.patch, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#49170] [PATCH v2]: gnu: Add python-fire
  2021-06-22 13:33 [bug#49170] [PATCH] New package: python-fire Danial Behzadi
  2021-06-26 13:19 ` دانیال بهزادی
  2021-06-26 19:43 ` [bug#49170] [PATCH v2]: gnu: Add python-fire دانیال بهزادی
@ 2021-06-26 19:52 ` دانیال بهزادی
  2021-06-28 21:30   ` Maxime Devos
  2021-06-26 20:06 ` bug#49170: (no subject) Raghav Gururajan via Guix-patches via
  3 siblings, 1 reply; 9+ messages in thread
From: دانیال بهزادی @ 2021-06-26 19:52 UTC (permalink / raw)
  To: 49170


[-- Attachment #1.1: Type: text/plain, Size: 63 bytes --]

Sorry. The previous one was malformed. This is the correct one.

[-- Attachment #1.2: Type: text/html, Size: 104 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-python-fire.patch --]
[-- Type: text/x-diff; name=0001-gnu-Add-python-fire.patch, Size: 2451 bytes --]

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(+)

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


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* bug#49170: (no subject)
  2021-06-22 13:33 [bug#49170] [PATCH] New package: python-fire Danial Behzadi
                   ` (2 preceding siblings ...)
  2021-06-26 19:52 ` دانیال بهزادی
@ 2021-06-26 20:06 ` Raghav Gururajan via Guix-patches via
  3 siblings, 0 replies; 9+ messages in thread
From: Raghav Gururajan via Guix-patches via @ 2021-06-26 20:06 UTC (permalink / raw)
  To: 49170-done


[-- Attachment #1.1: Type: text/plain, Size: 60 bytes --]

Thank you for the contribution.

Pushed as 1f15a6559b.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#49170] [PATCH v2]: gnu: Add python-fire
  2021-06-26 19:52 ` دانیال بهزادی
@ 2021-06-28 21:30   ` Maxime Devos
  2021-06-28 21:50     ` Raghav Gururajan via Guix-patches via
  2021-06-28 21:57     ` دانیال بهزادی
  0 siblings, 2 replies; 9+ messages in thread
From: Maxime Devos @ 2021-06-28 21:30 UTC (permalink / raw)
  To: دانیال بهزادی,
	49170
  Cc: Raghav Gururajan

[-- Attachment #1: Type: text/plain, Size: 716 bytes --]

> +    (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 #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#49170] [PATCH v2]: gnu: Add python-fire
  2021-06-28 21:30   ` Maxime Devos
@ 2021-06-28 21:50     ` Raghav Gururajan via Guix-patches via
  2021-06-28 21:57     ` دانیال بهزادی
  1 sibling, 0 replies; 9+ messages in thread
From: Raghav Gururajan via Guix-patches via @ 2021-06-28 21:50 UTC (permalink / raw)
  To: Maxime Devos
  Cc: 49170,
	دانیال بهزادی


[-- Attachment #1.1: Type: text/plain, Size: 661 bytes --]

Hi Maxim!

> 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.

> 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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#49170] [PATCH v2]: gnu: Add python-fire
  2021-06-28 21:30   ` Maxime Devos
  2021-06-28 21:50     ` Raghav Gururajan via Guix-patches via
@ 2021-06-28 21:57     ` دانیال بهزادی
  2021-06-29  8:06       ` Maxime Devos
  1 sibling, 1 reply; 9+ messages in thread
From: دانیال بهزادی @ 2021-06-28 21:57 UTC (permalink / raw)
  To: Maxime Devos, 49170; +Cc: Raghav Gururajan

[-- Attachment #1: Type: text/plain, Size: 1000 bytes --]

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> نوشت:
>> +    (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 #2: Type: text/html, Size: 1526 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#49170] [PATCH v2]: gnu: Add python-fire
  2021-06-28 21:57     ` دانیال بهزادی
@ 2021-06-29  8:06       ` Maxime Devos
  0 siblings, 0 replies; 9+ messages in thread
From: Maxime Devos @ 2021-06-29  8:06 UTC (permalink / raw)
  To: دانیال بهزادی,
	49170

[-- Attachment #1: Type: text/plain, Size: 1161 bytes --]

دانیال بهزادی schreef op ma 28-06-2021 om 21:57 [+0000]:
> 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:
<https://issues.guix.gnu.org/48320>. A sample of
'./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.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-06-29  8:07 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-22 13:33 [bug#49170] [PATCH] New package: python-fire Danial Behzadi
2021-06-26 13:19 ` دانیال بهزادی
2021-06-26 19:43 ` [bug#49170] [PATCH v2]: gnu: Add python-fire دانیال بهزادی
2021-06-26 19:52 ` دانیال بهزادی
2021-06-28 21:30   ` Maxime Devos
2021-06-28 21:50     ` Raghav Gururajan via Guix-patches via
2021-06-28 21:57     ` دانیال بهزادی
2021-06-29  8:06       ` Maxime Devos
2021-06-26 20:06 ` bug#49170: (no subject) Raghav Gururajan via Guix-patches via

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).