python.pkgs.odfpy: fix build

This commit is contained in:
Robert Schütz 2019-03-02 14:23:42 +01:00
parent f9ab0f25f8
commit 434c2a045b
1 changed files with 9 additions and 5 deletions

View File

@ -3,6 +3,8 @@
, fetchPypi , fetchPypi
, python , python
, isPy27 , isPy27
, defusedxml
, pytest
}: }:
buildPythonPackage rec { buildPythonPackage rec {
@ -14,15 +16,17 @@ buildPythonPackage rec {
sha256 = "596021f0519623ca8717331951c95e3b8d7b21e86edc7efe8cb650a0d0f59a2b"; sha256 = "596021f0519623ca8717331951c95e3b8d7b21e86edc7efe8cb650a0d0f59a2b";
}; };
# Python 2.7 uses a different ordering for xml namespaces. propagatedBuildInputs = [ defusedxml ];
# The testAttributeForeign test expects "ns44", but fails since it gets "ns43"
checkPhase = " " + lib.optionalString (!isPy27) '' checkInputs = [ pytest ];
${python.interpreter} -m unittest discover -s tests
checkPhase = ''
pytest
''; '';
meta = { meta = {
description = "Python API and tools to manipulate OpenDocument files"; 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; license = lib.licenses.asl20;
}; };
} }