unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: Add pyparsing.
@ 2014-11-25 16:55 Federico Beffa
  2014-11-25 17:11 ` Ludovic Courtès
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Federico Beffa @ 2014-11-25 16:55 UTC (permalink / raw)
  To: Guix-devel

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

Please find attached a pyparsing package for review.

Regards,
Fede

[-- Attachment #2: 0001-gnu-Add-pyparsing.patch --]
[-- Type: text/x-patch, Size: 2873 bytes --]

From edebe9d7663932912c6245abd690795fc02c1d02 Mon Sep 17 00:00:00 2001
From: Federico Beffa <beffa@fbengineering.ch>
Date: Tue, 25 Nov 2014 16:27:33 +0100
Subject: [PATCH] gnu: Add pyparsing.

* gnu/packages/python.scm (python-pyparsing, python2-pyparsing): New
  variables.
---
 gnu/packages/python.scm | 54 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 7967201..d9715c0 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -1932,3 +1932,57 @@ capabilities.")
 
 (define python2-numpy-bootstrap
   (package-with-python2 python-numpy-bootstrap))
+
+(define-public python-pyparsing
+  (package
+    (name "python-pyparsing")
+    (version "2.0.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "mirror://sourceforge/pyparsing"
+                           "/pyparsing-" version ".tar.gz"))
+       (sha256
+        (base32
+         "01lasib0n2fp2k99c988qhz16lm9hcwmnmrmhybdb3jq2xmkvr0p"))))
+    (build-system python-build-system)
+    (outputs '("out" "doc"))
+    (arguments
+     `(#:tests? #f ; no test target
+       #:modules ((guix build python-build-system)
+                  (guix build utils))
+       #:phases
+       (alist-cons-after
+        'install 'install-doc
+        (lambda* (#:key outputs #:allow-other-keys)
+          (let* ((doc (string-append (assoc-ref outputs "doc") 
+                                     "/share/doc/" ,name "-" ,version))
+                 (html-doc (string-append doc "/html"))
+                 (examples (string-append doc "/examples")))
+            (mkdir-p html-doc)
+            (mkdir-p examples)
+            (with-directory-excursion "docs"
+              (map (lambda (file) 
+                     (copy-file file (string-append doc "/" file)))
+                   (find-files "." ".*")))
+            (with-directory-excursion "htmldoc"
+              (map (lambda (file) 
+                     (copy-file file (string-append html-doc "/" file)))
+                   (find-files "." ".*")))
+            (with-directory-excursion "examples"
+              (map (lambda (file) 
+                     (copy-file file (string-append examples "/" file)))
+                   (find-files "." ".*")))))
+        %standard-phases)))
+    (home-page "http://pyparsing.wikispaces.com")
+    (synopsis "A Python parsing module")
+    (description
+     "The pyparsing module is an alternative approach to creating and
+executing simple grammars, vs. the traditional lex/yacc approach, or the use
+of regular expressions. The pyparsing module provides a library of classes
+that client code uses to construct the grammar directly in Python code.")
+    (license expat)))
+
+(define-public python2-pyparsing
+  (package-with-python2 python-pyparsing))
+
-- 
1.8.4


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

* Re: [PATCH] gnu: Add pyparsing.
  2014-11-25 16:55 [PATCH] gnu: Add pyparsing Federico Beffa
@ 2014-11-25 17:11 ` Ludovic Courtès
  2014-11-25 17:17 ` Cyril Roelandt
  2014-11-25 17:21 ` Eric Bavier
  2 siblings, 0 replies; 7+ messages in thread
From: Ludovic Courtès @ 2014-11-25 17:11 UTC (permalink / raw)
  To: Federico Beffa; +Cc: Guix-devel

Federico Beffa <beffa@ieee.org> skribis:

> From edebe9d7663932912c6245abd690795fc02c1d02 Mon Sep 17 00:00:00 2001
> From: Federico Beffa <beffa@fbengineering.ch>
> Date: Tue, 25 Nov 2014 16:27:33 +0100
> Subject: [PATCH] gnu: Add pyparsing.
>
> * gnu/packages/python.scm (python-pyparsing, python2-pyparsing): New
>   variables.

[...]

> +    (synopsis "A Python parsing module")

Please remove “A”.  Perhaps “Python parsing class library” would be more
descriptive?

OK to push with a change along these lines.

Thank you,
Ludo’.

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

* Re: [PATCH] gnu: Add pyparsing.
  2014-11-25 16:55 [PATCH] gnu: Add pyparsing Federico Beffa
  2014-11-25 17:11 ` Ludovic Courtès
@ 2014-11-25 17:17 ` Cyril Roelandt
  2014-11-25 17:21 ` Eric Bavier
  2 siblings, 0 replies; 7+ messages in thread
From: Cyril Roelandt @ 2014-11-25 17:17 UTC (permalink / raw)
  To: guix-devel

On 11/25/2014 05:55 PM, Federico Beffa wrote:
> Please find attached a pyparsing package for review.
>

Review inlined.

> Regards,
> Fede
> 
> 
> 0001-gnu-Add-pyparsing.patch
> 
> 
> From edebe9d7663932912c6245abd690795fc02c1d02 Mon Sep 17 00:00:00 2001
> From: Federico Beffa <beffa@fbengineering.ch>
> Date: Tue, 25 Nov 2014 16:27:33 +0100
> Subject: [PATCH] gnu: Add pyparsing.
> 
> * gnu/packages/python.scm (python-pyparsing, python2-pyparsing): New
>   variables.
> ---
>  gnu/packages/python.scm | 54 +++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 54 insertions(+)
> 
> diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
> index 7967201..d9715c0 100644
> --- a/gnu/packages/python.scm
> +++ b/gnu/packages/python.scm
> @@ -1932,3 +1932,57 @@ capabilities.")
>  
>  (define python2-numpy-bootstrap
>    (package-with-python2 python-numpy-bootstrap))
> +
> +(define-public python-pyparsing
> +  (package
> +    (name "python-pyparsing")
> +    (version "2.0.2")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (string-append "mirror://sourceforge/pyparsing"
> +                           "/pyparsing-" version ".tar.gz"))

Maybe you could add the PyPI mirror here.

> +       (sha256
> +        (base32
> +         "01lasib0n2fp2k99c988qhz16lm9hcwmnmrmhybdb3jq2xmkvr0p"))))
> +    (build-system python-build-system)
> +    (outputs '("out" "doc"))
> +    (arguments
> +     `(#:tests? #f ; no test target

There is a "unitTests.py" that can be run manually, if I'm not mistaken.
Maybe you could replace the check phase ?

> +       #:modules ((guix build python-build-system)
> +                  (guix build utils))
> +       #:phases
> +       (alist-cons-after
> +        'install 'install-doc
> +        (lambda* (#:key outputs #:allow-other-keys)
> +          (let* ((doc (string-append (assoc-ref outputs "doc") 
> +                                     "/share/doc/" ,name "-" ,version))
> +                 (html-doc (string-append doc "/html"))
> +                 (examples (string-append doc "/examples")))
> +            (mkdir-p html-doc)
> +            (mkdir-p examples)
> +            (with-directory-excursion "docs"
> +              (map (lambda (file) 
> +                     (copy-file file (string-append doc "/" file)))
> +                   (find-files "." ".*")))
> +            (with-directory-excursion "htmldoc"
> +              (map (lambda (file) 
> +                     (copy-file file (string-append html-doc "/" file)))
> +                   (find-files "." ".*")))
> +            (with-directory-excursion "examples"
> +              (map (lambda (file) 
> +                     (copy-file file (string-append examples "/" file)))
> +                   (find-files "." ".*")))))
> +        %standard-phases)))

I trust you on the doc thing :) Is it something that could somehow be
part of the python build system?


> +    (home-page "http://pyparsing.wikispaces.com")
> +    (synopsis "A Python parsing module")

Do not start the synopsis by "a". You may want to run "guix lint" on
your package to find such issues.

> +    (description
> +     "The pyparsing module is an alternative approach to creating and
> +executing simple grammars, vs. the traditional lex/yacc approach, or the use
> +of regular expressions. The pyparsing module provides a library of classes
> +that client code uses to construct the grammar directly in Python code.")
> +    (license expat)))
> +
> +(define-public python2-pyparsing
> +  (package-with-python2 python-pyparsing))
> +

Thanks!
Cyril.

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

* Re: [PATCH] gnu: Add pyparsing.
  2014-11-25 16:55 [PATCH] gnu: Add pyparsing Federico Beffa
  2014-11-25 17:11 ` Ludovic Courtès
  2014-11-25 17:17 ` Cyril Roelandt
@ 2014-11-25 17:21 ` Eric Bavier
  2014-11-25 17:51   ` Federico Beffa
  2014-11-25 19:47   ` Federico Beffa
  2 siblings, 2 replies; 7+ messages in thread
From: Eric Bavier @ 2014-11-25 17:21 UTC (permalink / raw)
  To: Federico Beffa; +Cc: Guix-devel


Federico Beffa writes:

> Please find attached a pyparsing package for review.
[...]
> +            (with-directory-excursion "docs"
> +              (map (lambda (file) 
> +                     (copy-file file (string-append doc "/" file)))
> +                   (find-files "." ".*")))
> +            (with-directory-excursion "htmldoc"
> +              (map (lambda (file) 
> +                     (copy-file file (string-append html-doc "/" file)))
> +                   (find-files "." ".*")))
> +            (with-directory-excursion "examples"
> +              (map (lambda (file) 
> +                     (copy-file file (string-append examples "/" file)))
> +                   (find-files "." ".*")))))

Perhaps:

(for-each
  (lambda (dir tgt)
    (for-each (lambda (file)
                (copy-file file
                           (string-append tgt "/" (basename file))))
              (find-files dir ".*")))
  (list "docs" "htmldoc" "examples")
  (list doc html-doc exmples)
   
Not tested of course ;)

Also, try running the package through `guix lint`.

-- 
Eric Bavier

Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html

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

* Re: [PATCH] gnu: Add pyparsing.
  2014-11-25 17:21 ` Eric Bavier
@ 2014-11-25 17:51   ` Federico Beffa
  2014-11-26 16:40     ` Cyril Roelandt
  2014-11-25 19:47   ` Federico Beffa
  1 sibling, 1 reply; 7+ messages in thread
From: Federico Beffa @ 2014-11-25 17:51 UTC (permalink / raw)
  To: Eric Bavier; +Cc: Guix-devel

Cyril Roelandt <tipecaml@gmail.com> writes:

>
> Maybe you could add the PyPI mirror here.
>

I'm not sure I understand. Do you mean replace or really add? A second
uri field? Could you give an example? The sourceforge download site is
the one mentioned on the homepage.

>
> There is a "unitTests.py" that can be run manually, if I'm not mistaken.
> Maybe you could replace the check phase ?
>

I do not think so.  I do not see any reference to tests in the README
and other source files and I can't find a file called "unitTests.py".

>
> I trust you on the doc thing :) Is it something that could somehow be
> part of the python build system?
>

I'm not a python expert :-) From the few packages that I prepared
lately, I have the impression that each python library does something
different with the documentation.

>
> Do not start the synopsis by "a". You may want to run "guix lint" on
> your package to find such issues.
>

Ooops, forgot to run that.

Thanks for the review,
Fede

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

* Re: [PATCH] gnu: Add pyparsing.
  2014-11-25 17:21 ` Eric Bavier
  2014-11-25 17:51   ` Federico Beffa
@ 2014-11-25 19:47   ` Federico Beffa
  1 sibling, 0 replies; 7+ messages in thread
From: Federico Beffa @ 2014-11-25 19:47 UTC (permalink / raw)
  To: Eric Bavier; +Cc: Guix-devel

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

On Tue, Nov 25, 2014 at 6:21 PM, Eric Bavier <ericbavier@gmail.com> wrote:
>
> Perhaps:
>
> (for-each
>   (lambda (dir tgt)
>     (for-each (lambda (file)
>                 (copy-file file
>                            (string-append tgt "/" (basename file))))
>               (find-files dir ".*")))
>   (list "docs" "htmldoc" "examples")
>   (list doc html-doc exmples)
>
> Not tested of course ;)

Definitely less boilerplate :-)

Thanks,
Fede

[-- Attachment #2: 0001-gnu-Add-pyparsing.patch --]
[-- Type: text/x-patch, Size: 2589 bytes --]

From 10f16ec3d3cca44c89e33df81e050dff5ea8c7f1 Mon Sep 17 00:00:00 2001
From: Federico Beffa <beffa@fbengineering.ch>
Date: Tue, 25 Nov 2014 16:27:33 +0100
Subject: [PATCH] gnu: Add pyparsing.

* gnu/packages/python.scm (python-pyparsing, python2-pyparsing): New
  variables.
---
 gnu/packages/python.scm | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 7967201..c0eea3c 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -1932,3 +1932,52 @@ capabilities.")
 
 (define python2-numpy-bootstrap
   (package-with-python2 python-numpy-bootstrap))
+
+(define-public python-pyparsing
+  (package
+    (name "python-pyparsing")
+    (version "2.0.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "mirror://sourceforge/pyparsing"
+                           "/pyparsing-" version ".tar.gz"))
+       (sha256
+        (base32
+         "01lasib0n2fp2k99c988qhz16lm9hcwmnmrmhybdb3jq2xmkvr0p"))))
+    (build-system python-build-system)
+    (outputs '("out" "doc"))
+    (arguments
+     `(#:tests? #f ; no test target
+       #:modules ((guix build python-build-system)
+                  (guix build utils))
+       #:phases
+       (alist-cons-after
+        'install 'install-doc
+        (lambda* (#:key outputs #:allow-other-keys)
+          (let* ((doc (string-append (assoc-ref outputs "doc") 
+                                     "/share/doc/" ,name "-" ,version))
+                 (html-doc (string-append doc "/html"))
+                 (examples (string-append doc "/examples")))
+            (mkdir-p html-doc)
+            (mkdir-p examples)
+            (for-each 
+             (lambda (dir tgt)
+               (map (lambda (file) 
+                      (copy-file file (string-append tgt "/" (basename file))))
+                    (find-files dir ".*")))
+             (list "docs" "htmldoc" "examples")
+             (list doc html-doc examples))))
+        %standard-phases)))
+    (home-page "http://pyparsing.wikispaces.com")
+    (synopsis "Python parsing class library")
+    (description
+     "The pyparsing module is an alternative approach to creating and
+executing simple grammars, vs. the traditional lex/yacc approach, or the use
+of regular expressions.  The pyparsing module provides a library of classes
+that client code uses to construct the grammar directly in Python code.")
+    (license expat)))
+
+(define-public python2-pyparsing
+  (package-with-python2 python-pyparsing))
+
-- 
1.8.4


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

* Re: [PATCH] gnu: Add pyparsing.
  2014-11-25 17:51   ` Federico Beffa
@ 2014-11-26 16:40     ` Cyril Roelandt
  0 siblings, 0 replies; 7+ messages in thread
From: Cyril Roelandt @ 2014-11-26 16:40 UTC (permalink / raw)
  To: guix-devel

On 11/25/2014 06:51 PM, Federico Beffa wrote:
> Cyril Roelandt <tipecaml@gmail.com> writes:
> 
>>
>> Maybe you could add the PyPI mirror here.
>>
> 
> I'm not sure I understand. Do you mean replace or really add? A second
> uri field? Could you give an example? The sourceforge download site is
> the one mentioned on the homepage.

Yes. The "uri" field can be a list (see libpng for instance). It would
be nice to have two reliable mirrors here.

> 
>>
>> There is a "unitTests.py" that can be run manually, if I'm not mistaken.
>> Maybe you could replace the check phase ?
>>
> 
> I do not think so.  I do not see any reference to tests in the README
> and other source files and I can't find a file called "unitTests.py".

Oh, that might just be in the SVN repository, then.

> 
>>
>> I trust you on the doc thing :) Is it something that could somehow be
>> part of the python build system?
>>
> 
> I'm not a python expert :-) From the few packages that I prepared
> lately, I have the impression that each python library does something
> different with the documentation.

Sad but true.

> 
>>
>> Do not start the synopsis by "a". You may want to run "guix lint" on
>> your package to find such issues.
>>
> 
> Ooops, forgot to run that.
> 
> Thanks for the review,

Thanks for the package!

Cyril.

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

end of thread, other threads:[~2014-11-26 16:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-25 16:55 [PATCH] gnu: Add pyparsing Federico Beffa
2014-11-25 17:11 ` Ludovic Courtès
2014-11-25 17:17 ` Cyril Roelandt
2014-11-25 17:21 ` Eric Bavier
2014-11-25 17:51   ` Federico Beffa
2014-11-26 16:40     ` Cyril Roelandt
2014-11-25 19:47   ` Federico Beffa

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