From 89df48e9db6a75641b6a9932e0c741c8ba2c7037 Mon Sep 17 00:00:00 2001 From: aszlig Date: Fri, 27 Apr 2018 20:35:23 +0200 Subject: [PATCH] weboob: Disable doctests requiring networking Unfortunately I haven't found a way for nose to disable doctests and the -e/--exclude flag only works on unit tests. So I'm using sed in postPatch to remove the doctests without mangling the whole docstring. I've built weboob and it now succeeds. Signed-off-by: aszlig --- pkgs/development/python-modules/weboob/default.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/weboob/default.nix b/pkgs/development/python-modules/weboob/default.nix index a4b1b9c467a..73a70a65c38 100644 --- a/pkgs/development/python-modules/weboob/default.nix +++ b/pkgs/development/python-modules/weboob/default.nix @@ -16,6 +16,19 @@ buildPythonPackage rec { sha256 = "0m5yh49lplvb57dfilczh65ky35fshp3g7ni31pwfxwqi1f7i4f9"; }; + postPatch = '' + # Disable doctests that require networking: + sed -i -n -e '/^ *def \+pagination *(.*: *$/ { + p; n; p; /"""\|'\'\'\'''/!b + + :loop + n; /^ *\(>>>\|\.\.\.\)/ { h; bloop } + x; /^ *\(>>>\|\.\.\.\)/bloop; x + p; /"""\|'\'\'\'''/b + bloop + }; p' weboob/browser/browsers.py weboob/browser/pages.py + ''; + setupPyBuildFlags = ["--qt" "--xdg"]; checkInputs = [ nose ]; @@ -33,7 +46,6 @@ buildPythonPackage rec { homepage = http://weboob.org; description = "Collection of applications and APIs to interact with websites without requiring the user to open a browser"; license = stdenv.lib.licenses.agpl3; - broken = true; # 2018-04-11 }; }