1{ buildPythonPackage, fetchurl, fetchPypi, 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 nativeBuildInputs = [ pyqt5 ];
37
38 propagatedBuildInputs = [ pillow prettytable pyyaml dateutil
39 gdata requests mechanize feedparser lxml gnupg pyqt5 libyaml
40 simplejson cssselect futures pdfminer termcolor
41 google_api_python_client html2text unidecode ];
42
43 checkPhase = ''
44 nosetests
45 '';
46
47 meta = {
48 homepage = http://weboob.org;
49 description = "Collection of applications and APIs to interact with websites without requiring the user to open a browser";
50 license = stdenv.lib.licenses.agpl3;
51 };
52}
53