1{ buildPythonPackage, fetchurl, stdenv, isPy27
2, nose, pillow, prettytable, pyyaml, dateutil, gdata
3, requests, mechanize, feedparser, lxml, gnupg, pyqt5
4, libyaml, simplejson, cssselect, futures, pdfminer
5, termcolor, google_api_python_client, html2text
6, unidecode
7}:
8
9buildPythonPackage rec {
10 pname = "weboob";
11 version = "1.3";
12 disabled = ! isPy27;
13
14 src = fetchurl {
15 url = "https://symlink.me/attachments/download/356/${pname}-${version}.tar.gz";
16 sha256 = "0m5yh49lplvb57dfilczh65ky35fshp3g7ni31pwfxwqi1f7i4f9";
17 };
18
19 postPatch = ''
20 # Disable doctests that require networking:
21 sed -i -n -e '/^ *def \+pagination *(.*: *$/ {
22 p; n; p; /"""\|'\'\'\'''/!b
23
24 :loop
25 n; /^ *\(>>>\|\.\.\.\)/ { h; bloop }
26 x; /^ *\(>>>\|\.\.\.\)/bloop; x
27 p; /"""\|'\'\'\'''/b
28 bloop
29 }; p' weboob/browser/browsers.py weboob/browser/pages.py
30 '';
31
32 setupPyBuildFlags = ["--qt" "--xdg"];
33
34 checkInputs = [ nose ];
35
36 propagatedBuildInputs = [ pillow prettytable pyyaml dateutil
37 gdata requests mechanize feedparser lxml gnupg pyqt5 libyaml
38 simplejson cssselect futures pdfminer termcolor google_api_python_client
39 html2text unidecode ];
40
41 checkPhase = ''
42 nosetests
43 '';
44
45 meta = {
46 homepage = http://weboob.org;
47 description = "Collection of applications and APIs to interact with websites without requiring the user to open a browser";
48 license = stdenv.lib.licenses.agpl3;
49 };
50}
51