From 434c2a045b34a905cfab22a81d2dd93f397f9624 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Robert=20Sch=C3=BCtz?=
 <robert.schuetz@stud.uni-heidelberg.de>
Date: Sat, 2 Mar 2019 14:23:42 +0100
Subject: [PATCH] python.pkgs.odfpy: fix build

---
 pkgs/development/python-modules/odfpy/default.nix | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/pkgs/development/python-modules/odfpy/default.nix b/pkgs/development/python-modules/odfpy/default.nix
index 1b732b66b38..f4dba0858db 100644
--- a/pkgs/development/python-modules/odfpy/default.nix
+++ b/pkgs/development/python-modules/odfpy/default.nix
@@ -3,6 +3,8 @@
 , fetchPypi
 , python
 , isPy27
+, defusedxml
+, pytest
 }:
 
 buildPythonPackage rec {
@@ -14,15 +16,17 @@ buildPythonPackage rec {
     sha256 = "596021f0519623ca8717331951c95e3b8d7b21e86edc7efe8cb650a0d0f59a2b";
   };
 
-  # Python 2.7 uses a different ordering for xml namespaces.
-  # The testAttributeForeign test expects "ns44", but fails since it gets "ns43"
-  checkPhase = " " + lib.optionalString (!isPy27) ''
-    ${python.interpreter} -m unittest discover -s tests
+  propagatedBuildInputs = [ defusedxml ];
+
+  checkInputs = [ pytest ];
+
+  checkPhase = ''
+    pytest
   '';
 
   meta = {
     description = "Python API and tools to manipulate OpenDocument files";
-    homepage = "https://joinup.ec.europa.eu/software/odfpy/home";
+    homepage = https://github.com/eea/odfpy;
     license = lib.licenses.asl20;
   };
 }