about summary refs log tree commit diff
path: root/pkgs/development/python-modules/weboob/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/weboob/default.nix')
-rw-r--r--pkgs/development/python-modules/weboob/default.nix59
1 files changed, 36 insertions, 23 deletions
diff --git a/pkgs/development/python-modules/weboob/default.nix b/pkgs/development/python-modules/weboob/default.nix
index b1afa242107ea..4d0373105ccff 100644
--- a/pkgs/development/python-modules/weboob/default.nix
+++ b/pkgs/development/python-modules/weboob/default.nix
@@ -1,9 +1,9 @@
-{ lib, buildPythonPackage, fetchPypi, isPy27
+{ lib
 , Babel
+, buildPythonPackage
 , cssselect
-, python-dateutil
 , feedparser
-, futures ? null
+, fetchPypi
 , gdata
 , gnupg
 , google-api-python-client
@@ -16,6 +16,9 @@
 , pillow
 , prettytable
 , pyqt5
+, pytestCheckHook
+, python-dateutil
+, pythonOlder
 , pyyaml
 , requests
 , simplejson
@@ -26,28 +29,18 @@
 buildPythonPackage rec {
   pname = "weboob";
   version = "2.0";
+  format = "setuptools";
+
+  disabled = pythonOlder "3.7";
 
   src = fetchPypi {
     inherit pname version;
     sha256 = "1c69vzf8sg8471lcaafpz9iw2q3rfj5hmcpqrs2k59fkgbvy32zw";
   };
 
-  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
-  '';
-
-  checkInputs = [ nose ];
-
-  nativeBuildInputs = [ pyqt5 ];
+  nativeBuildInputs = [
+    pyqt5
+  ];
 
   propagatedBuildInputs = [
     Babel
@@ -70,15 +63,35 @@ buildPythonPackage rec {
     simplejson
     termcolor
     unidecode
-  ] ++ lib.optionals isPy27 [ futures ];
+  ];
+
+  postPatch = ''
+    substituteInPlace setup.cfg \
+      --replace "with-doctest = 1" "" \
+      --replace "with-coverage = 1" "" \
+      --replace "weboob.browser.filters.standard," "" \
+      --replace "weboob.browser.tests.filters," "" \
+      --replace "weboob.tools.application.formatters.json," "" \
+      --replace "weboob.tools.application.formatters.table," "" \
+      --replace "weboob.tools.capabilities.bank.transactions," ""
+  '';
+
+  checkInputs = [
+    nose
+  ];
 
   checkPhase = ''
     nosetests
   '';
 
-  meta = {
+  pythonImportsCheck = [
+    "weboob"
+  ];
+
+  meta = with lib; {
+    description = "Collection of applications and APIs to interact with websites";
     homepage = "http://weboob.org";
-    description = "Collection of applications and APIs to interact with websites without requiring the user to open a browser";
-    license = lib.licenses.agpl3;
+    license = licenses.agpl3Plus;
+    maintainers = with maintainers; [ ];
   };
 }