]>
Commit | Line | Data |
---|---|---|
e77c7882 IB |
1 | { buildPythonPackage, fetchurl, fetchPypi, stdenv |
2 | , nose, pillow, prettytable, pyyaml, dateutil, gdata | |
3 | , requests, feedparser, lxml, gnupg, pyqt5 | |
4 | , libyaml, simplejson, cssselect, pdfminer | |
5 | , termcolor, google_api_python_client, html2text | |
6 | , unidecode, html5lib, Babel | |
7 | }: | |
8 | let | |
9 | mechanize = buildPythonPackage rec { | |
10 | pname = "mechanize"; | |
11 | version = "0.4.4"; | |
12 | src = fetchPypi { | |
13 | inherit version pname; | |
14 | sha256 = "9fff89e973bdf1aee75a351bd4dde53ca51a7e76944ddeae3ea3b6ad6c46045c"; | |
15 | }; | |
16 | propagatedBuildInputs = [ html5lib ]; | |
17 | doCheck = false; | |
18 | }; | |
19 | in | |
20 | ||
21 | buildPythonPackage rec { | |
22 | pname = "weboob"; | |
23 | version = "2.0"; | |
24 | ||
25 | src = fetchurl { | |
26 | url = "https://symlink.me/attachments/download/356/${pname}-${version}.tar.gz"; | |
27 | sha256 = "1p0wd6k28s0cdxkrj5s6vmi120w6v5vfxxyddqg7s2xjxv6mbbbm"; | |
28 | }; | |
29 | ||
30 | postPatch = '' | |
31 | # Disable doctests that require networking: | |
32 | sed -i -n -e '/^ *def \+pagination *(.*: *$/ { | |
33 | p; n; p; /"""\|'\'\'\'''/!b | |
34 | ||
35 | :loop | |
36 | n; /^ *\(>>>\|\.\.\.\)/ { h; bloop } | |
37 | x; /^ *\(>>>\|\.\.\.\)/bloop; x | |
38 | p; /"""\|'\'\'\'''/b | |
39 | bloop | |
40 | }; p' weboob/browser/browsers.py weboob/browser/pages.py | |
41 | ''; | |
42 | ||
43 | postInstall = '' | |
44 | mkdir -p $out/share/bash-completion/completions/ | |
45 | cp tools/weboob_bash_completion $out/share/bash-completion/completions/weboob | |
46 | ''; | |
47 | ||
48 | checkInputs = [ nose ]; | |
49 | ||
50 | nativeBuildInputs = [ pyqt5 ]; | |
51 | ||
52 | propagatedBuildInputs = [ pillow prettytable pyyaml dateutil | |
53 | gdata requests feedparser lxml gnupg pyqt5 libyaml | |
54 | simplejson cssselect mechanize pdfminer termcolor | |
55 | google_api_python_client html2text unidecode Babel ]; | |
56 | ||
57 | checkPhase = '' | |
58 | nosetests | |
59 | ''; | |
60 | ||
61 | meta = { | |
62 | homepage = http://weboob.org; | |
63 | description = "Collection of applications and APIs to interact with websites without requiring the user to open a browser"; | |
64 | license = stdenv.lib.licenses.agpl3; | |
65 | }; | |
66 | } | |
67 |