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

Yt 04308e46 d92f98ee

Changed files
+20
pkgs
development
python-modules
cleanlab
+20
pkgs/development/python-modules/cleanlab/default.nix
···
lib,
buildPythonPackage,
fetchFromGitHub,
+
fetchpatch,
# build-system
setuptools,
···
tag = "v${version}";
hash = "sha256-0kCEIHNOXIkdwDH5zCVWnR/W79ppc/1PFsJ/a4goGzk=";
};
+
+
patches = [
+
# https://github.com/cleanlab/cleanlab/pull/1224
+
(fetchpatch {
+
name = "numpy2-compatibility";
+
url = "https://github.com/GaetanLepage/cleanlab/commit/7d4cef11cf8d58b0ca7dba78f4c64995ed709274.patch";
+
hash = "sha256-1mLEITYj30F9tJh8tajWnpGC5FANh8he/lgw1f+LAsI=";
+
})
+
];
build-system = [ setuptools ];
+
pythonRelaxDeps = [
+
"numpy"
+
];
+
dependencies = [
numpy
scikit-learn
···
[
# Requires the datasets we prevent from downloading
"test_create_imagelab"
+
+
# Non-trivial numpy2 incompatibilities
+
# assert np.float64(0.492) == 0.491
+
"test_duplicate_points_have_similar_scores"
+
# AssertionError: assert 'Annotators [1] did not label any examples.'
+
"test_label_quality_scores_multiannotator"
]
++ lib.optionals (pythonAtLeast "3.12") [
# AttributeError: 'called_once_with' is not a valid assertion.