Patchwork [2/3] gnu: Add python-pyxb.

login
register
mail settings
Submitter Marius Bakke
Date Sept. 17, 2016, 10:10 a.m.
Message ID <20160917101047.4597-3-mbakke@fastmail.com>
Download mbox | patch
Permalink /patch/15703/
State New
Headers show

Comments

Marius Bakke - Sept. 17, 2016, 10:10 a.m.
* gnu/packages/xml.scm (python-pyxb, python2-pyxb): New variables.
---
 gnu/packages/xml.scm | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)
Ben Woodcroft - Sept. 20, 2016, 6:34 a.m.
Oops, forgot to cc the list.


On 20/09/16 16:02, Ben Woodcroft wrote:
> Hi Marius,
>
> Thanks for the patches.
>
> On 17/09/16 20:10, Marius Bakke wrote:
>> [..]
>> +         (add-after 'unpack 'fix-tests
>> +           (lambda _
>> +             ;; See https://github.com/pabigot/pyxb/issues/26 ...
>> +             (delete-file "tests/trac/test-trac-0091.py")
>
> The fix for that test failing seems straightforward enough, might be 
> better to include as a patch so those tests are run.
> https://github.com/pabigot/pyxb/commit/d4bdd5a1c712cd70f96264ae13b55d015cbf3335 
>
>
>> +             ;; ...and https://github.com/pabigot/pyxb/pull/58 .
>> +             (substitute* "tests/utils/test-utility.py"
>> +               (("__NoExt_re = re.compile.*$")
>> +                "__NoExt_re = re.compile('(^|\\%s)[^\\.]+$' % 
>> os.sep)\n"))
>
> Good catch there. It would be preferable to add this change as a patch 
> as well, because it is more likely to apply correctly (not that it 
> won't here), and also because when it is no longer needed after this 
> package gets updated the patch will fail to apply alerting the updater 
> to the fact it should be removed. As a bonus, my experience is that 
> working with patches easier than using substitute* so require less 
> builds before getting to a happy package.
>
> I have not actually built these packages, but they look fine 
> otherwise. Would you mind sending an updated patch for pyxb, and then 
> I'll probably apply all three (assuming I find nothing else, which I 
> don't anticipate).
>
> Thanks,
> ben
Ben Woodcroft - Sept. 20, 2016, 7:06 a.m.
Hi again,


On 20/09/16 16:34, Ben Woodcroft wrote:
> Oops, forgot to cc the list.
>
>
> On 20/09/16 16:02, Ben Woodcroft wrote:
>> Hi Marius,
>>
>> Thanks for the patches.
>>
>> On 17/09/16 20:10, Marius Bakke wrote:
>>> [..]
>>> +         (add-after 'unpack 'fix-tests
>>> +           (lambda _
>>> +             ;; See https://github.com/pabigot/pyxb/issues/26 ...
>>> +             (delete-file "tests/trac/test-trac-0091.py")
>>
>> The fix for that test failing seems straightforward enough, might be 
>> better to include as a patch so those tests are run.
>> https://github.com/pabigot/pyxb/commit/d4bdd5a1c712cd70f96264ae13b55d015cbf3335 
>>
Actually, 1.2.5 just got released which has both of these fixes. Can you 
send an updated patch please?

Thanks.

Patch

diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm
index 7befad5..793cd2f 100644
--- a/gnu/packages/xml.scm
+++ b/gnu/packages/xml.scm
@@ -13,6 +13,7 @@ 
 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2016 ng0 <ng0@we.make.ritual.n0.is>
 ;;; Copyright © 2016 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -729,6 +730,42 @@  different Unicode encodings which happen automatically during
 parsing/saving.")
     (license license:expat)))
 
+(define-public python-pyxb
+  (package
+    (name "python-pyxb")
+    (version "1.2.4")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "PyXB" version))
+              (sha256
+               (base32
+                "0sgs184mq218li5qqi906hm55zkpqbiyinv9wk6qgqgx813rskq2"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'fix-tests
+           (lambda _
+             ;; See https://github.com/pabigot/pyxb/issues/26 ...
+             (delete-file "tests/trac/test-trac-0091.py")
+             ;; ...and https://github.com/pabigot/pyxb/pull/58 .
+             (substitute* "tests/utils/test-utility.py"
+               (("__NoExt_re = re.compile.*$")
+                "__NoExt_re = re.compile('(^|\\%s)[^\\.]+$' % os.sep)\n"))
+             #t)))))
+    (home-page "http://pyxb.sourceforge.net/")
+    (synopsis "Python XML Schema Bindings")
+    (description
+     "PyXB (\"pixbee\") is a pure Python package that generates Python source
+code for classes that correspond to data structures defined by XMLSchema.")
+    (license (list license:asl2.0    ; Most files.
+                   license:expat     ; pyxb/utils/six.py
+                   license:gpl2      ; bundled jquery in doc is dual MIT/GPL2
+                   license:psfl))))  ; pyxb/utils/activestate.py
+
+(define-public python2-pyxb
+  (package-with-python2 python-pyxb))
+
 (define-public xmlto
   (package
     (name "xmlto")