about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/imbalanced-learn/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/imbalanced-learn/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/imbalanced-learn/default.nix63
1 files changed, 46 insertions, 17 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/imbalanced-learn/default.nix b/nixpkgs/pkgs/development/python-modules/imbalanced-learn/default.nix
index 1ef8fea6a100..585e043e4eb3 100644
--- a/nixpkgs/pkgs/development/python-modules/imbalanced-learn/default.nix
+++ b/nixpkgs/pkgs/development/python-modules/imbalanced-learn/default.nix
@@ -1,43 +1,72 @@
 { lib
 , buildPythonPackage
 , fetchPypi
-, isPy27
+, pythonOlder
+, setuptools
+, joblib
+, keras
+, numpy
 , pandas
-, pytestCheckHook
 , scikit-learn
+, scipy
+, tensorflow
+, threadpoolctl
+, pytest-xdist
+, pytestCheckHook
 }:
 
 buildPythonPackage rec {
   pname = "imbalanced-learn";
-  version = "0.11.0";
-  format = "setuptools";
-  disabled = isPy27; # scikit-learn>=0.21 doesn't work on python2
+  version = "0.12.0";
+  pyproject = true;
+
+  disabled = pythonOlder "3.8";
 
   src = fetchPypi {
     inherit pname version;
-    hash = "sha256-dYKuiFjm2wuS/vl90IZgoYKX7hKNeMKr3ABri9hrj9w=";
+    hash = "sha256-uczZqqMChpkHnUOm1Nn8nQOfVTdnM7Mfh8fZsSXcwWU=";
   };
 
-  propagatedBuildInputs = [ scikit-learn ];
+  nativeBuildInputs = [
+    setuptools
+  ];
+
+  propagatedBuildInputs = [
+    joblib
+    numpy
+    scikit-learn
+    scipy
+    threadpoolctl
+  ];
+
+  passthru.optional-dependencies = {
+    optional = [
+      keras
+      pandas
+      tensorflow
+    ];
+  };
+
+  pythonImportsCheck = [
+    "imblearn"
+  ];
+
   nativeCheckInputs = [ pytestCheckHook pandas ];
+
   preCheck = ''
     export HOME=$TMPDIR
   '';
-  disabledTests = [
-    "estimator"
-    "classification"
-    "_generator"
-    "show_versions"
-    "test_make_imbalanced_iris"
-    "test_rusboost[SAMME.R]"
-
-    # https://github.com/scikit-learn-contrib/imbalanced-learn/issues/824
-    "ValueDifferenceMetric"
+
+  disabledTestPaths = [
+    # require tensorflow and keras, but we don't want to
+    # add them to nativeCheckInputs just for this tests
+    "imblearn/keras/_generator.py"
   ];
 
   meta = with lib; {
     description = "Library offering a number of re-sampling techniques commonly used in datasets showing strong between-class imbalance";
     homepage = "https://github.com/scikit-learn-contrib/imbalanced-learn";
+    changelog = "https://github.com/scikit-learn-contrib/imbalanced-learn/releases/tag/${version}";
     license = licenses.mit;
     maintainers = [ maintainers.rmcgibbo ];
   };