From 69a8b546b6d3e7ed5c22d6fd320d9657462dfea2 Mon Sep 17 00:00:00 2001 From: "Robert T. McGibbon" Date: Wed, 3 Feb 2021 11:04:08 -0500 Subject: [PATCH] python3Packages.scikitlearn: patch for numpy 1.20.0 --- .../python-modules/scikitlearn/default.nix | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/scikitlearn/default.nix b/pkgs/development/python-modules/scikitlearn/default.nix index e7307c926320..7e9e37831e0d 100644 --- a/pkgs/development/python-modules/scikitlearn/default.nix +++ b/pkgs/development/python-modules/scikitlearn/default.nix @@ -3,25 +3,38 @@ , buildPythonPackage , fetchPypi , fetchpatch -, gfortran, glibcLocales -, numpy, scipy, pytest, pillow +, gfortran +, glibcLocales +, numpy +, scipy +, pytest +, pillow , cython , joblib , llvmPackages , threadpoolctl +, pythonOlder }: buildPythonPackage rec { pname = "scikit-learn"; version = "0.24.1"; - # UnboundLocalError: local variable 'message' referenced before assignment - disabled = stdenv.isi686; # https://github.com/scikit-learn/scikit-learn/issues/5534 + disabled = pythonOlder "3.6"; src = fetchPypi { inherit pname version; sha256 = "oDNKGALmTWVgIsO/q1anP71r9LEpg0PzaIryFRgQu98="; }; + patches = [ + # This patch fixes compatibility with numpy 1.20. It was merged before 0.24.1 was released, + # but for some reason was not included in the 0.24.1 release tarball. + (fetchpatch { + url = "https://github.com/scikit-learn/scikit-learn/commit/e7ef22c3ba2334cb3b476e95d7c083cf6b48ce56.patch"; + sha256 = "174554k1pbf92bj7wgq0xjj16bkib32ailyhwavdxaknh4bd9nmv"; + }) + ]; + buildInputs = [ pillow gfortran