From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marius Bakke Subject: Re: [PATCH v2] gnu: Add python-odfpy. Date: Fri, 02 Sep 2016 12:55:01 +0100 Message-ID: <87d1kmqzxm.fsf@ike.i-did-not-set--mail-host-address--so-tickle-me> References: <87h99zr5kb.fsf@ike.i-did-not-set--mail-host-address--so-tickle-me> <8737li4rvq.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39418) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bfn42-0002j3-3g for guix-devel@gnu.org; Fri, 02 Sep 2016 07:55:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bfn3y-0003on-UT for guix-devel@gnu.org; Fri, 02 Sep 2016 07:55:18 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:35824) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bfn3w-0003jD-FE for guix-devel@gnu.org; Fri, 02 Sep 2016 07:55:14 -0400 In-Reply-To: <8737li4rvq.fsf@gmail.com> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Alex Kost Cc: guix-devel@gnu.org --=-=-= Content-Type: text/plain Alex Kost writes: > Marius Bakke (2016-09-01 18:41 +0300) wrote: > >> From f1bccf9bf26088107b6fec31eece30676d5a362f Mon Sep 17 00:00:00 2001 >> From: Marius Bakke >> 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. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-gnu-Add-python-odfpy.patch Content-Transfer-Encoding: quoted-printable >From 99216a79ddd817ce7be9da451c0a1b5d9ef73f46 Mon Sep 17 00:00:00 2001 From: Marius Bakke 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 =C2=A9 2016 ng0 ;;; Copyright =C2=A9 2016 Dylan Jeffers ;;; Copyright =C2=A9 2016 David Craven +;;; Copyright =C2=A9 2016 Marius Bakke ;;; ;;; 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)) --=20 2.9.3 --=-=-=--