unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: Add python-xlrd.
@ 2015-09-19 13:38 Ben Woodcroft
  2015-09-19 15:49 ` Mathieu Lirzin
  0 siblings, 1 reply; 9+ messages in thread
From: Ben Woodcroft @ 2015-09-19 13:38 UTC (permalink / raw)
  To: guix-devel@gnu.org

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

Thanks in advance for review.

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

From cb470509de810ea93ac4e576bb0347225b68ad98 Mon Sep 17 00:00:00 2001
From: Ben Woodcroft <donttrustben@gmail.com>
Date: Sat, 19 Sep 2015 23:35:18 +1000
Subject: [PATCH] gnu: Add python-xlrd.

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

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 408064d..b9ecf3e 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -11,6 +11,7 @@
 ;;; Copyright © 2015 Christopher Allan Webber <cwebber@dustycloud.org>
 ;;; Copyright © 2015 Eric Dvorsak <eric@dvorsak.fr>
 ;;; Copyright © 2015 Leo Famulari <leo@famulari.name>
+;;; Copyright © 2015 Ben Woodcroft <donttrustben@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -4880,3 +4881,39 @@ object to help create WSGI responses.")
 
 (define-public python2-webob
   (package-with-python2 python-webob))
+
+(define-public python-xlrd
+  (package
+    (name "python-xlrd")
+    (version "0.9.4")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://pypi.python.org/packages/source/x/xlrd/xlrd-"
+             version
+             ".tar.gz"))
+       (sha256
+        (base32
+         "0wpa55nvidmm5m2qr622dsh3cj46akdk0h3zjgzschcmydck73cf"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         ;; current test in setup.py does not work as of 0.9.4,
+         ;; so use nose to run tests instead for now.
+         (replace 'check (lambda _ (zero? (system* "nosetests")))))))
+    (native-inputs
+     `(("python-setuptools" ,python2-setuptools)
+       ("python-nose" ,python2-nose)))
+    (home-page "http://www.python-excel.org/")
+    (synopsis
+     "Library for extracting data from Microsoft Excel (tm) files")
+    (description
+     "Extract data from Excel spreadsheets (.xls and .xlsx, versions 2.0
+onwards) on any platform.  It is pure Python (2.6, 2.7, 3.2+), has support for
+Excel dates and is Unicode-aware.")
+    (license bsd-3)))
+
+(define-public python2-xlrd
+  (package-with-python2 python-xlrd))
-- 
2.4.3


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

* Re: [PATCH] gnu: Add python-xlrd.
  2015-09-19 13:38 [PATCH] gnu: Add python-xlrd Ben Woodcroft
@ 2015-09-19 15:49 ` Mathieu Lirzin
  2015-09-19 15:53   ` Andreas Enge
  2015-09-19 20:08   ` Ricardo Wurmus
  0 siblings, 2 replies; 9+ messages in thread
From: Mathieu Lirzin @ 2015-09-19 15:49 UTC (permalink / raw)
  To: Ben Woodcroft; +Cc: guix-devel@gnu.org

Ben Woodcroft <b.woodcroft@uq.edu.au> writes:

> From cb470509de810ea93ac4e576bb0347225b68ad98 Mon Sep 17 00:00:00 2001
> From: Ben Woodcroft <donttrustben@gmail.com>
> Date: Sat, 19 Sep 2015 23:35:18 +1000
> Subject: [PATCH] gnu: Add python-xlrd.
>
> * gnu/packages/python.scm (python-xlrd, python2-xlrd): New variables.
> ---
>  gnu/packages/python.scm | 37 +++++++++++++++++++++++++++++++++++++
>  1 file changed, 37 insertions(+)

[...]

> +    (arguments
> +     `(#:phases
> +       (modify-phases %standard-phases
> +         ;; current test in setup.py does not work as of 0.9.4,

“Current”

> +         ;; so use nose to run tests instead for now.
> +         (replace 'check (lambda _ (zero? (system* "nosetests")))))))
> +    (native-inputs
> +     `(("python-setuptools" ,python2-setuptools)
> +       ("python-nose" ,python2-nose)))

I don't know python packaging but when I look at other packages it
seems that these are usually used as “inputs” not
“native-inputs”.

I think it should be “python-*” instead of “python-2”.  Am I wrong?

> +    (home-page "http://www.python-excel.org/")
> +    (synopsis
> +     "Library for extracting data from Microsoft Excel (tm) files")
> +    (description
> +     "Extract data from Excel spreadsheets (.xls and .xlsx, versions 2.0
> +onwards) on any platform.  It is pure Python (2.6, 2.7, 3.2+), has support for
> +Excel dates and is Unicode-aware.")

What about something like this?

        (synopsis "Library for extracting data from Excel files")
        (description "This packages provides a library to extract data from
    spreadsheets using Microsoft Excel® proprietary file formats @samp{.xls} and
    @samp{.xlsx} (versions 2.0 onwards).  It has support for Excel dates and is
    Unicode-aware.  It is not intended as an end-user tool.")

> +    (license bsd-3)))
> +(define-public python2-xlrd
> +  (package-with-python2 python-xlrd))

--
Mathieu Lirzin

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

* Re: [PATCH] gnu: Add python-xlrd.
  2015-09-19 15:49 ` Mathieu Lirzin
@ 2015-09-19 15:53   ` Andreas Enge
  2015-09-19 20:08   ` Ricardo Wurmus
  1 sibling, 0 replies; 9+ messages in thread
From: Andreas Enge @ 2015-09-19 15:53 UTC (permalink / raw)
  To: Mathieu Lirzin; +Cc: guix-devel@gnu.org

On Sat, Sep 19, 2015 at 05:49:28PM +0200, Mathieu Lirzin wrote:
> > +    (native-inputs
> > +     `(("python-setuptools" ,python2-setuptools)
> > +       ("python-nose" ,python2-nose)))
> I don't know python packaging but when I look at other packages it
> seems that these are usually used as “inputs” not
> “native-inputs”.

There was a discussion about python-setuptools; I do not remember the
outcome... For python-nose, it seems to be used for tests only, so
native-inputs would be the right field.

Can this not be checked by running
   guix gc --references `guix build python-xlrd`
and seeing whether the packages are referenced or not?

> I think it should be “python-*” instead of “python-2”.  Am I wrong?

Yes, the package-with-python procedure will rewrite this for the python2-xlrd
package.

Andreas

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

* Re: [PATCH] gnu: Add python-xlrd.
  2015-09-19 15:49 ` Mathieu Lirzin
  2015-09-19 15:53   ` Andreas Enge
@ 2015-09-19 20:08   ` Ricardo Wurmus
  2015-09-19 20:37     ` Mathieu Lirzin
  1 sibling, 1 reply; 9+ messages in thread
From: Ricardo Wurmus @ 2015-09-19 20:08 UTC (permalink / raw)
  To: Mathieu Lirzin; +Cc: guix-devel@gnu.org


Mathieu Lirzin <mthl@openmailbox.org> writes:

>> +         ;; so use nose to run tests instead for now.
>> +         (replace 'check (lambda _ (zero? (system* "nosetests")))))))
>> +    (native-inputs
>> +     `(("python-setuptools" ,python2-setuptools)
>> +       ("python-nose" ,python2-nose)))
>
> I don't know python packaging but when I look at other packages it
> seems that these are usually used as “inputs” not
> “native-inputs”.

Nose is used for the tests only and setuptools is used at build time, so
I think it’s fine like this.

~~ Ricardo

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

* Re: [PATCH] gnu: Add python-xlrd.
  2015-09-19 20:08   ` Ricardo Wurmus
@ 2015-09-19 20:37     ` Mathieu Lirzin
  2015-09-20  0:48       ` Ben Woodcroft
  2015-09-20  7:41       ` Ricardo Wurmus
  0 siblings, 2 replies; 9+ messages in thread
From: Mathieu Lirzin @ 2015-09-19 20:37 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel@gnu.org

Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> writes:

> Mathieu Lirzin <mthl@openmailbox.org> writes:
>
>>> +         ;; so use nose to run tests instead for now.
>>> +         (replace 'check (lambda _ (zero? (system* "nosetests")))))))
>>> +    (native-inputs
>>> +     `(("python-setuptools" ,python2-setuptools)
>>> +       ("python-nose" ,python2-nose)))
>>
>> I don't know python packaging but when I look at other packages it
>> seems that these are usually used as “inputs” not
>> “native-inputs”.
>
> Nose is used for the tests only and setuptools is used at build time, so
> I think it’s fine like this.

Is this a general statement or something specific to this package? If
this is general it seems to be a good idea to make a big commit that
fixes all the python packages which use these dependencies as normal
inputs?  WDYT?

--
Mathieu Lirzin

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

* Re: [PATCH] gnu: Add python-xlrd.
  2015-09-19 20:37     ` Mathieu Lirzin
@ 2015-09-20  0:48       ` Ben Woodcroft
  2015-09-27 20:10         ` Ludovic Courtès
  2015-09-20  7:41       ` Ricardo Wurmus
  1 sibling, 1 reply; 9+ messages in thread
From: Ben Woodcroft @ 2015-09-20  0:48 UTC (permalink / raw)
  To: Mathieu Lirzin, Ricardo Wurmus; +Cc: guix-devel@gnu.org



On 20/09/15 06:37, Mathieu Lirzin wrote:
> Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> writes:
>
>> Mathieu Lirzin <mthl@openmailbox.org> writes:
>>
>>>> +         ;; so use nose to run tests instead for now.
>>>> +         (replace 'check (lambda _ (zero? (system* "nosetests")))))))
>>>> +    (native-inputs
>>>> +     `(("python-setuptools" ,python2-setuptools)
>>>> +       ("python-nose" ,python2-nose)))
>>> I don't know python packaging but when I look at other packages it
>>> seems that these are usually used as “inputs” not
>>> “native-inputs”.
>> Nose is used for the tests only and setuptools is used at build time, so
>> I think it’s fine like this.
> Is this a general statement or something specific to this package? If
> this is general it seems to be a good idea to make a big commit that
> fixes all the python packages which use these dependencies as normal
> inputs?  WDYT?
If someone were to change things wholesale, it might also be a good idea 
to change the pypi importer to match.

Let me know when you want me to send an updated patch - all your 
comments look good to me Marthieu.

ben

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

* Re: [PATCH] gnu: Add python-xlrd.
  2015-09-19 20:37     ` Mathieu Lirzin
  2015-09-20  0:48       ` Ben Woodcroft
@ 2015-09-20  7:41       ` Ricardo Wurmus
  1 sibling, 0 replies; 9+ messages in thread
From: Ricardo Wurmus @ 2015-09-20  7:41 UTC (permalink / raw)
  To: Mathieu Lirzin; +Cc: guix-devel@gnu.org


Mathieu Lirzin <mthl@openmailbox.org> writes:

>>> I don't know python packaging but when I look at other packages it
>>> seems that these are usually used as “inputs” not
>>> “native-inputs”.
>>
>> Nose is used for the tests only and setuptools is used at build time, so
>> I think it’s fine like this.
>
> Is this a general statement or something specific to this package? If
> this is general it seems to be a good idea to make a big commit that
> fixes all the python packages which use these dependencies as normal
> inputs?  WDYT?

I can’t say if this is true for all Python packages, but for those that
I have packaged I have always done it this way without any problems.

~~ Ricardo

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

* Re: [PATCH] gnu: Add python-xlrd.
  2015-09-20  0:48       ` Ben Woodcroft
@ 2015-09-27 20:10         ` Ludovic Courtès
  2015-10-01 21:48           ` Mathieu Lirzin
  0 siblings, 1 reply; 9+ messages in thread
From: Ludovic Courtès @ 2015-09-27 20:10 UTC (permalink / raw)
  To: Ben Woodcroft; +Cc: guix-devel@gnu.org

Ben Woodcroft <b.woodcroft@uq.edu.au> skribis:

> On 20/09/15 06:37, Mathieu Lirzin wrote:
>> Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> writes:
>>
>>> Mathieu Lirzin <mthl@openmailbox.org> writes:
>>>
>>>>> +         ;; so use nose to run tests instead for now.
>>>>> +         (replace 'check (lambda _ (zero? (system* "nosetests")))))))
>>>>> +    (native-inputs
>>>>> +     `(("python-setuptools" ,python2-setuptools)
>>>>> +       ("python-nose" ,python2-nose)))
>>>> I don't know python packaging but when I look at other packages it
>>>> seems that these are usually used as “inputs” not
>>>> “native-inputs”.
>>> Nose is used for the tests only and setuptools is used at build time, so
>>> I think it’s fine like this.
>> Is this a general statement or something specific to this package? If
>> this is general it seems to be a good idea to make a big commit that
>> fixes all the python packages which use these dependencies as normal
>> inputs?  WDYT?
> If someone were to change things wholesale, it might also be a good
> idea to change the pypi importer to match.
>
> Let me know when you want me to send an updated patch - all your
> comments look good to me Marthieu.

Mathieu, Ricardo: It seems to me that this patch should go in.  The
other issues can be discussed separately IMO; WDYT?

Ludo’.

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

* Re: [PATCH] gnu: Add python-xlrd.
  2015-09-27 20:10         ` Ludovic Courtès
@ 2015-10-01 21:48           ` Mathieu Lirzin
  0 siblings, 0 replies; 9+ messages in thread
From: Mathieu Lirzin @ 2015-10-01 21:48 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel@gnu.org

ludo@gnu.org (Ludovic Courtès) writes:

> Ben Woodcroft <b.woodcroft@uq.edu.au> skribis:
>
>> On 20/09/15 06:37, Mathieu Lirzin wrote:
>>> Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> writes:
>>>
>>>> Mathieu Lirzin <mthl@openmailbox.org> writes:
>>>>
>>>>>> +         ;; so use nose to run tests instead for now.
>>>>>> +         (replace 'check (lambda _ (zero? (system* "nosetests")))))))
>>>>>> +    (native-inputs
>>>>>> +     `(("python-setuptools" ,python2-setuptools)
>>>>>> +       ("python-nose" ,python2-nose)))
>>>>> I don't know python packaging but when I look at other packages it
>>>>> seems that these are usually used as “inputs” not
>>>>> “native-inputs”.
>>>> Nose is used for the tests only and setuptools is used at build time, so
>>>> I think it’s fine like this.
>>> Is this a general statement or something specific to this package? If
>>> this is general it seems to be a good idea to make a big commit that
>>> fixes all the python packages which use these dependencies as normal
>>> inputs?  WDYT?
>> If someone were to change things wholesale, it might also be a good
>> idea to change the pypi importer to match.
>>
>> Let me know when you want me to send an updated patch - all your
>> comments look good to me Marthieu.
>
> Mathieu, Ricardo: It seems to me that this patch should go in.  The
> other issues can be discussed separately IMO; WDYT?

Pushed with the changes in 02a8a1876a9facd52fa71e76a5fdab8c97063eca

sorry for the delay. Thanks Ben.

--
Mathieu Lirzin

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

end of thread, other threads:[~2015-10-01 21:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-19 13:38 [PATCH] gnu: Add python-xlrd Ben Woodcroft
2015-09-19 15:49 ` Mathieu Lirzin
2015-09-19 15:53   ` Andreas Enge
2015-09-19 20:08   ` Ricardo Wurmus
2015-09-19 20:37     ` Mathieu Lirzin
2015-09-20  0:48       ` Ben Woodcroft
2015-09-27 20:10         ` Ludovic Courtès
2015-10-01 21:48           ` Mathieu Lirzin
2015-09-20  7:41       ` Ricardo Wurmus

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