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

This commit is contained in:
Yt
2025-01-09 11:27:11 -05:00
committed by GitHub
@@ -2,6 +2,7 @@
lib,
buildPythonPackage,
fetchFromGitHub,
fetchpatch,
# build-system
setuptools,
@@ -42,8 +43,21 @@ buildPythonPackage rec {
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
@@ -79,6 +93,12 @@ buildPythonPackage rec {
[
# 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.