1{ lib
2, buildPythonPackage
3, fetchPypi
4, python
5, isPy27
6}:
7
8buildPythonPackage rec {
9 pname = "odfpy";
10 version = "1.3.6";
11 name = "${pname}-${version}";
12
13 src = fetchPypi {
14 inherit pname version;
15 sha256 = "6bcaf3b23aa9e49ed8c8c177266539b211add4e02402748a994451482a10cb1b";
16 };
17
18 # Python 2.7 uses a different ordering for xml namespaces.
19 # The testAttributeForeign test expects "ns44", but fails since it gets "ns43"
20 checkPhase = " " + lib.optionalString (!isPy27) ''
21 ${python.interpreter} -m unittest discover -s tests
22 '';
23
24 meta = {
25 description = "Python API and tools to manipulate OpenDocument files";
26 homepage = "https://joinup.ec.europa.eu/software/odfpy/home";
27 license = lib.licenses.asl20;
28 };
29}