1{ lib
2, buildPythonPackage
3, fetchPypi
4, isPy3k
5, apipkg
6, bottle
7, gevent
8, lxml
9, odfpy
10, pillow
11, py
12, pyPdf
13, pyparsing
14, qserve
15, roman
16, simplejson
17, sqlite3dbm
18, timelib
19, pytest
20}:
21
22buildPythonPackage rec {
23 version = "0.16.1";
24 pname = "mwlib";
25 disabled = isPy3k;
26
27 src = fetchPypi {
28 inherit pname version;
29 sha256 = "1dnmnkc21zdfaypskbpvkwl0wpkpn0nagj1fc338w64mbxrk8ny7";
30 };
31
32 propagatedBuildInputs = [ apipkg bottle gevent lxml odfpy pillow py pyPdf pyparsing qserve roman simplejson sqlite3dbm timelib ];
33
34 checkInputs = [ pytest ];
35
36 postPatch = ''
37 sed -i "s/odfpy>=0.9, <0.10/odfpy/" setup.py
38 sed -i "s/pyparsing>=1.4.11,<1.6/pyparsing/" setup.py
39 '';
40
41 checkPhase = ''
42 py.test
43 '';
44
45 # Tests are in build directory but we need extension modules that are in $out
46 doCheck = false;
47
48 meta = with lib; {
49 description = "Library for parsing MediaWiki articles and converting them to different output formats";
50 homepage = "http://pediapress.com/code/";
51 license = licenses.bsd3;
52 # broken = true; # Requires different versions of packages
53 };
54
55}