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 2 lib, 3 3 buildPythonPackage, 4 4 fetchFromGitHub, 5 + fetchpatch, 5 6 6 7 # build-system 7 8 setuptools, ··· 41 42 tag = "v${version}"; 42 43 hash = "sha256-0kCEIHNOXIkdwDH5zCVWnR/W79ppc/1PFsJ/a4goGzk="; 43 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 + ]; 44 54 45 55 build-system = [ setuptools ]; 46 56 57 + pythonRelaxDeps = [ 58 + "numpy" 59 + ]; 60 + 47 61 dependencies = [ 48 62 numpy 49 63 scikit-learn ··· 79 93 [ 80 94 # Requires the datasets we prevent from downloading 81 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" 82 102 ] 83 103 ++ lib.optionals (pythonAtLeast "3.12") [ 84 104 # AttributeError: 'called_once_with' is not a valid assertion.