python312Packages.cleanlab: fix build by patching numpy2 incompatibilities (#372059)

authored by Yt and committed by GitHub 04308e46 d92f98ee

+20
+20
pkgs/development/python-modules/cleanlab/default.nix
··· 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 6 # build-system 7 setuptools, ··· 41 tag = "v${version}"; 42 hash = "sha256-0kCEIHNOXIkdwDH5zCVWnR/W79ppc/1PFsJ/a4goGzk="; 43 }; 44 45 build-system = [ setuptools ]; 46 47 dependencies = [ 48 numpy 49 scikit-learn ··· 79 [ 80 # Requires the datasets we prevent from downloading 81 "test_create_imagelab" 82 ] 83 ++ lib.optionals (pythonAtLeast "3.12") [ 84 # AttributeError: 'called_once_with' is not a valid assertion.
··· 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 + fetchpatch, 6 7 # build-system 8 setuptools, ··· 42 tag = "v${version}"; 43 hash = "sha256-0kCEIHNOXIkdwDH5zCVWnR/W79ppc/1PFsJ/a4goGzk="; 44 }; 45 + 46 + patches = [ 47 + # https://github.com/cleanlab/cleanlab/pull/1224 48 + (fetchpatch { 49 + name = "numpy2-compatibility"; 50 + url = "https://github.com/GaetanLepage/cleanlab/commit/7d4cef11cf8d58b0ca7dba78f4c64995ed709274.patch"; 51 + hash = "sha256-1mLEITYj30F9tJh8tajWnpGC5FANh8he/lgw1f+LAsI="; 52 + }) 53 + ]; 54 55 build-system = [ setuptools ]; 56 57 + pythonRelaxDeps = [ 58 + "numpy" 59 + ]; 60 + 61 dependencies = [ 62 numpy 63 scikit-learn ··· 93 [ 94 # Requires the datasets we prevent from downloading 95 "test_create_imagelab" 96 + 97 + # Non-trivial numpy2 incompatibilities 98 + # assert np.float64(0.492) == 0.491 99 + "test_duplicate_points_have_similar_scores" 100 + # AssertionError: assert 'Annotators [1] did not label any examples.' 101 + "test_label_quality_scores_multiannotator" 102 ] 103 ++ lib.optionals (pythonAtLeast "3.12") [ 104 # AttributeError: 'called_once_with' is not a valid assertion.