pythonPackages.woob: init at 3.0

+138
+82
pkgs/development/python-modules/woob/default.nix
···
··· 1 + { lib 2 + , buildPythonPackage 3 + , fetchPypi 4 + , isPy27 5 + , Babel 6 + , colorama 7 + , cssselect 8 + , dateutil 9 + , feedparser 10 + , futures 11 + , gdata 12 + , gnupg 13 + , google-api-python-client 14 + , html2text 15 + , libyaml 16 + , lxml 17 + , mechanize 18 + , nose 19 + , pdfminer 20 + , pillow 21 + , prettytable 22 + , pyqt5 23 + , pyyaml 24 + , requests 25 + , simplejson 26 + , termcolor 27 + , unidecode 28 + }: 29 + 30 + buildPythonPackage rec { 31 + pname = "woob"; 32 + version = "3.0"; 33 + 34 + src = fetchPypi { 35 + inherit pname version; 36 + sha256 = "09hpxy5zhn2b8li0xjf3zd7s46lawb0315p5mdcsci3bj3s4v1j7"; 37 + }; 38 + 39 + patches = [ 40 + # Disable doctests that require networking: 41 + ./no-test-requiring-network.patch 42 + ]; 43 + 44 + checkInputs = [ nose ]; 45 + 46 + nativeBuildInputs = [ pyqt5 ]; 47 + 48 + propagatedBuildInputs = [ 49 + Babel 50 + colorama 51 + cssselect 52 + dateutil 53 + feedparser 54 + gdata 55 + gnupg 56 + google-api-python-client 57 + html2text 58 + libyaml 59 + lxml 60 + mechanize 61 + pdfminer 62 + pillow 63 + prettytable 64 + pyqt5 65 + pyyaml 66 + requests 67 + simplejson 68 + termcolor 69 + unidecode 70 + ] ++ lib.optionals isPy27 [ futures ]; 71 + 72 + checkPhase = '' 73 + nosetests 74 + ''; 75 + 76 + meta = with lib; { 77 + homepage = "https://woob.tech"; 78 + description = "Collection of applications and APIs to interact with websites without requiring the user to open a browser"; 79 + license = licenses.lgpl3Plus; 80 + maintainers = [ maintainers.DamienCassou ]; 81 + }; 82 + }
+54
pkgs/development/python-modules/woob/no-test-requiring-network.patch
···
··· 1 + --- a/woob/browser/browsers.py 2 + +++ b/woob/browser/browsers.py 3 + @@ -930,23 +930,6 @@ 4 + 5 + :class:`NextPage` constructor can take an url or a Request object. 6 + 7 + - >>> from .pages import HTMLPage 8 + - >>> class Page(HTMLPage): 9 + - ... def iter_values(self): 10 + - ... for el in self.doc.xpath('//li'): 11 + - ... yield el.text 12 + - ... for next in self.doc.xpath('//a'): 13 + - ... raise NextPage(next.attrib['href']) 14 + - ... 15 + - >>> class Browser(PagesBrowser): 16 + - ... BASEURL = 'https://woob.tech' 17 + - ... list = URL('/tests/list-(?P<pagenum>\d+).html', Page) 18 + - ... 19 + - >>> b = Browser() 20 + - >>> b.list.go(pagenum=1) # doctest: +ELLIPSIS 21 + - <woob.browser.browsers.Page object at 0x...> 22 + - >>> list(b.pagination(lambda: b.page.iter_values())) 23 + - ['One', 'Two', 'Three', 'Four'] 24 + """ 25 + while True: 26 + try: 27 + --- a/woob/browser/pages.py 28 + +++ b/woob/browser/pages.py 29 + @@ -49,25 +49,6 @@ 30 + 31 + :class:`NextPage` constructor can take an url or a Request object. 32 + 33 + - >>> class Page(HTMLPage): 34 + - ... @pagination 35 + - ... def iter_values(self): 36 + - ... for el in self.doc.xpath('//li'): 37 + - ... yield el.text 38 + - ... for next in self.doc.xpath('//a'): 39 + - ... raise NextPage(next.attrib['href']) 40 + - ... 41 + - >>> from .browsers import PagesBrowser 42 + - >>> from .url import URL 43 + - >>> class Browser(PagesBrowser): 44 + - ... BASEURL = 'https://woob.tech' 45 + - ... list = URL('/tests/list-(?P<pagenum>\d+).html', Page) 46 + - ... 47 + - >>> b = Browser() 48 + - >>> b.list.go(pagenum=1) # doctest: +ELLIPSIS 49 + - <woob.browser.pages.Page object at 0x...> 50 + - >>> list(b.page.iter_values()) 51 + - ['One', 'Two', 'Three', 'Four'] 52 + """ 53 + 54 + @wraps(func)
+2
pkgs/top-level/python-packages.nix
··· 8987 8988 wled = callPackage ../development/python-modules/wled { }; 8989 8990 word2vec = callPackage ../development/python-modules/word2vec { }; 8991 8992 wordcloud = callPackage ../development/python-modules/wordcloud { };
··· 8987 8988 wled = callPackage ../development/python-modules/wled { }; 8989 8990 + woob = callPackage ../development/python-modules/woob { }; 8991 + 8992 word2vec = callPackage ../development/python-modules/word2vec { }; 8993 8994 wordcloud = callPackage ../development/python-modules/wordcloud { };