python3Packages.woob: disable doctest and coverage

This commit is contained in:
Fabian Affolter
2022-01-25 11:07:10 +01:00
parent b8882c701d
commit cd0e58e561
2 changed files with 31 additions and 72 deletions
@@ -1,12 +1,10 @@
{ lib
, buildPythonPackage
, fetchPypi
, isPy27
, Babel
, buildPythonPackage
, colorama
, cssselect
, python-dateutil
, feedparser
, fetchFromGitLab
, gdata
, gnupg
, google-api-python-client
@@ -19,6 +17,8 @@
, pillow
, prettytable
, pyqt5
, python-dateutil
, pythonOlder
, pyyaml
, requests
, simplejson
@@ -29,22 +29,21 @@
buildPythonPackage rec {
pname = "woob";
version = "3.0";
disabled = isPy27;
format = "setuptools";
src = fetchPypi {
inherit pname version;
sha256 = "09hpxy5zhn2b8li0xjf3zd7s46lawb0315p5mdcsci3bj3s4v1j7";
disabled = pythonOlder "3.7";
src = fetchFromGitLab {
owner = "woob";
repo = pname;
rev = version;
hash = "sha256-XLcHNidclORbxVXgcsHY6Ja/dak+EVSKTaVQmg1f/rw=";
};
patches = [
# Disable doctests that require networking:
./no-test-requiring-network.patch
nativeBuildInputs = [
pyqt5
];
checkInputs = [ nose ];
nativeBuildInputs = [ pyqt5 ];
propagatedBuildInputs = [
Babel
colorama
@@ -69,14 +68,28 @@ buildPythonPackage rec {
unidecode
];
postPatch = ''
substituteInPlace setup.cfg \
--replace "with-doctest = 1" "" \
--replace "with-coverage = 1" ""
'';
checkInputs = [
nose
];
checkPhase = ''
nosetests
'';
pythonImportsCheck = [
"woob"
];
meta = with lib; {
description = "Collection of applications and APIs to interact with websites";
homepage = "https://woob.tech";
description = "Collection of applications and APIs to interact with websites without requiring the user to open a browser";
license = licenses.lgpl3Plus;
maintainers = [ maintainers.DamienCassou ];
};
maintainers = with maintainers; [ DamienCassou ];
};
}
@@ -1,54 +0,0 @@
--- a/woob/browser/browsers.py
+++ b/woob/browser/browsers.py
@@ -930,23 +930,6 @@
:class:`NextPage` constructor can take an url or a Request object.
- >>> from .pages import HTMLPage
- >>> class Page(HTMLPage):
- ... def iter_values(self):
- ... for el in self.doc.xpath('//li'):
- ... yield el.text
- ... for next in self.doc.xpath('//a'):
- ... raise NextPage(next.attrib['href'])
- ...
- >>> class Browser(PagesBrowser):
- ... BASEURL = 'https://woob.tech'
- ... list = URL('/tests/list-(?P<pagenum>\d+).html', Page)
- ...
- >>> b = Browser()
- >>> b.list.go(pagenum=1) # doctest: +ELLIPSIS
- <woob.browser.browsers.Page object at 0x...>
- >>> list(b.pagination(lambda: b.page.iter_values()))
- ['One', 'Two', 'Three', 'Four']
"""
while True:
try:
--- a/woob/browser/pages.py
+++ b/woob/browser/pages.py
@@ -49,25 +49,6 @@
:class:`NextPage` constructor can take an url or a Request object.
- >>> class Page(HTMLPage):
- ... @pagination
- ... def iter_values(self):
- ... for el in self.doc.xpath('//li'):
- ... yield el.text
- ... for next in self.doc.xpath('//a'):
- ... raise NextPage(next.attrib['href'])
- ...
- >>> from .browsers import PagesBrowser
- >>> from .url import URL
- >>> class Browser(PagesBrowser):
- ... BASEURL = 'https://woob.tech'
- ... list = URL('/tests/list-(?P<pagenum>\d+).html', Page)
- ...
- >>> b = Browser()
- >>> b.list.go(pagenum=1) # doctest: +ELLIPSIS
- <woob.browser.pages.Page object at 0x...>
- >>> list(b.page.iter_values())
- ['One', 'Two', 'Three', 'Four']
"""
@wraps(func)