* [PATCH v2] gnu: Add python-odfpy.
@ 2016-09-01 15:41 Marius Bakke
2016-09-02 8:39 ` Alex Kost
0 siblings, 1 reply; 4+ messages in thread
From: Marius Bakke @ 2016-09-01 15:41 UTC (permalink / raw)
To: guix-devel
[-- Attachment #1: 0001-gnu-Add-python-odfpy.patch --]
[-- Type: text/x-patch, Size: 2411 bytes --]
From f1bccf9bf26088107b6fec31eece30676d5a362f Mon Sep 17 00:00:00 2001
From: Marius Bakke <mbakke@fastmail.com>
Date: Wed, 17 Aug 2016 17:45:24 +0100
Subject: [PATCH] gnu: Add python-odfpy.
* gnu/packages/python.scm (python-odfpy, python2-odfpy): New variables.
---
gnu/packages/python.scm | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 09fe627..f5c7498 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -26,6 +26,7 @@
;;; Copyright © 2016 ng0 <ng0@we.make.ritual.n0.is>
;;; Copyright © 2016 Dylan Jeffers <sapientech@sapientech@openmailbox.org>
;;; Copyright © 2016 David Craven <david@craven.ch>
+;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -10264,3 +10265,36 @@ time by mocking the datetime module.")
(native-inputs
`(("python2-setuptools" ,python2-setuptools)
,@(package-native-inputs base))))))
+
+(define-public python-odfpy
+ (package
+ (name "python-odfpy")
+ (version "1.3.3")
+ (source (origin
+ (method url-fetch)
+ (uri (pypi-uri "odfpy" version))
+ (sha256
+ (base32
+ "1a6ms0w9zfhhkqhvrnynwwbxrivw6hgjc0s5k7j06npc7rq0blxw"))))
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (replace 'check
+ ;; The test runner invokes python2 and python3 for test*.py.
+ ;; To avoid having both in inputs, we replicate it here.
+ (lambda _
+ (for-each (lambda (test-file)
+ (zero? (system* "python" test-file)))
+ (find-files "tests" "^test.*\\.py$")))))))
+ (build-system python-build-system)
+ (home-page "https://github.com/eea/odfpy")
+ (synopsis "Python API and tools to manipulate OpenDocument files")
+ (description "Collection of libraries and utility programs written in
+Python to manipulate OpenDocument 1.2 files.")
+ (license
+ ;; The software is mainly dual GPL2+ and ASL2.0, but includes a
+ ;; number of files with different licenses.
+ (list license:gpl2+ license:asl2.0 license:lgpl2.1+ license:cc-by-sa3.0))))
+
+(define-public python2-odfpy
+ (package-with-python2 python-odfpy))
--
2.9.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] gnu: Add python-odfpy.
2016-09-01 15:41 [PATCH v2] gnu: Add python-odfpy Marius Bakke
@ 2016-09-02 8:39 ` Alex Kost
2016-09-02 11:55 ` Marius Bakke
0 siblings, 1 reply; 4+ messages in thread
From: Alex Kost @ 2016-09-02 8:39 UTC (permalink / raw)
To: Marius Bakke; +Cc: guix-devel
Marius Bakke (2016-09-01 18:41 +0300) wrote:
> From f1bccf9bf26088107b6fec31eece30676d5a362f Mon Sep 17 00:00:00 2001
> From: Marius Bakke <mbakke@fastmail.com>
> Date: Wed, 17 Aug 2016 17:45:24 +0100
> Subject: [PATCH] gnu: Add python-odfpy.
>
> * gnu/packages/python.scm (python-odfpy, python2-odfpy): New variables.
[...]
> + (arguments
> + `(#:phases
> + (modify-phases %standard-phases
> + (replace 'check
> + ;; The test runner invokes python2 and python3 for test*.py.
> + ;; To avoid having both in inputs, we replicate it here.
> + (lambda _
> + (for-each (lambda (test-file)
'every' procedure should be used here instead: 'for-each' is for side
effects only, its returned value is unspecified; and with 'every', the
check phase will fail if any of the tests fails.
And since 'every' is from (srfi srfi-1) module, we need to use it in
'arguments', like this:
#:modules ((srfi srfi-1)
(guix build python-build-system)
(guix build utils))
The rest looks good to me, so if there will be no other comments, I will
commit it in several days, thanks!
> + (zero? (system* "python" test-file)))
> + (find-files "tests" "^test.*\\.py$")))))))
> + (build-system python-build-system)
> + (home-page "https://github.com/eea/odfpy")
> + (synopsis "Python API and tools to manipulate OpenDocument files")
> + (description "Collection of libraries and utility programs written in
> +Python to manipulate OpenDocument 1.2 files.")
> + (license
> + ;; The software is mainly dual GPL2+ and ASL2.0, but includes a
> + ;; number of files with different licenses.
> + (list license:gpl2+ license:asl2.0 license:lgpl2.1+ license:cc-by-sa3.0))))
> +
> +(define-public python2-odfpy
> + (package-with-python2 python-odfpy))
--
Alex
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] gnu: Add python-odfpy.
2016-09-02 8:39 ` Alex Kost
@ 2016-09-02 11:55 ` Marius Bakke
2016-09-04 7:34 ` Alex Kost
0 siblings, 1 reply; 4+ messages in thread
From: Marius Bakke @ 2016-09-02 11:55 UTC (permalink / raw)
To: Alex Kost; +Cc: guix-devel
[-- Attachment #1: Type: text/plain, Size: 975 bytes --]
Alex Kost <alezost@gmail.com> writes:
> Marius Bakke (2016-09-01 18:41 +0300) wrote:
>
>> From f1bccf9bf26088107b6fec31eece30676d5a362f Mon Sep 17 00:00:00 2001
>> From: Marius Bakke <mbakke@fastmail.com>
>> Date: Wed, 17 Aug 2016 17:45:24 +0100
>> Subject: [PATCH] gnu: Add python-odfpy.
>>
>> * gnu/packages/python.scm (python-odfpy, python2-odfpy): New variables.
> [...]
>> + (arguments
>> + `(#:phases
>> + (modify-phases %standard-phases
>> + (replace 'check
>> + ;; The test runner invokes python2 and python3 for test*.py.
>> + ;; To avoid having both in inputs, we replicate it here.
>> + (lambda _
>> + (for-each (lambda (test-file)
>
> 'every' procedure should be used here instead: 'for-each' is for side
> effects only, its returned value is unspecified; and with 'every', the
> check phase will fail if any of the tests fails.
Thanks Alex, that's really useful to know.
I've updated the patch.
[-- Attachment #2: 0001-gnu-Add-python-odfpy.patch --]
[-- Type: text/x-patch, Size: 2530 bytes --]
From 99216a79ddd817ce7be9da451c0a1b5d9ef73f46 Mon Sep 17 00:00:00 2001
From: Marius Bakke <mbakke@fastmail.com>
Date: Wed, 17 Aug 2016 17:45:24 +0100
Subject: [PATCH] gnu: Add python-odfpy.
* gnu/packages/python.scm (python-odfpy, python2-odfpy): 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 8b52548..33674fa 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -26,6 +26,7 @@
;;; Copyright © 2016 ng0 <ng0@we.make.ritual.n0.is>
;;; Copyright © 2016 Dylan Jeffers <sapientech@sapientech@openmailbox.org>
;;; Copyright © 2016 David Craven <david@craven.ch>
+;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -10241,3 +10242,39 @@ time by mocking the datetime module.")
(native-inputs
`(("python2-setuptools" ,python2-setuptools)
,@(package-native-inputs base))))))
+
+(define-public python-odfpy
+ (package
+ (name "python-odfpy")
+ (version "1.3.3")
+ (source (origin
+ (method url-fetch)
+ (uri (pypi-uri "odfpy" version))
+ (sha256
+ (base32
+ "1a6ms0w9zfhhkqhvrnynwwbxrivw6hgjc0s5k7j06npc7rq0blxw"))))
+ (arguments
+ `(#:modules ((srfi srfi-1)
+ (guix build python-build-system)
+ (guix build utils))
+ #:phases
+ (modify-phases %standard-phases
+ (replace 'check
+ ;; The test runner invokes python2 and python3 for test*.py.
+ ;; To avoid having both in inputs, we replicate it here.
+ (lambda _
+ (every (lambda (test-file)
+ (zero? (system* "python" test-file)))
+ (find-files "tests" "^test.*\\.py$")))))))
+ (build-system python-build-system)
+ (home-page "https://github.com/eea/odfpy")
+ (synopsis "Python API and tools to manipulate OpenDocument files")
+ (description "Collection of libraries and utility programs written in
+Python to manipulate OpenDocument 1.2 files.")
+ (license
+ ;; The software is mainly dual GPL2+ and ASL2.0, but includes a
+ ;; number of files with other licenses.
+ (list license:gpl2+ license:asl2.0 license:lgpl2.1+ license:cc-by-sa3.0))))
+
+(define-public python2-odfpy
+ (package-with-python2 python-odfpy))
--
2.9.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-09-04 7:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-01 15:41 [PATCH v2] gnu: Add python-odfpy Marius Bakke
2016-09-02 8:39 ` Alex Kost
2016-09-02 11:55 ` Marius Bakke
2016-09-04 7:34 ` Alex Kost
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.