Skip to content

Commit

Permalink
python312Packages.cleanlab: fix build by patching numpy2 incompatibil…
Browse files Browse the repository at this point in the history
…ities (NixOS#372059)
  • Loading branch information
happysalada authored Jan 9, 2025
2 parents d92f98e + a9ceeb3 commit 04308e4
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions pkgs/development/python-modules/cleanlab/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
lib,
buildPythonPackage,
fetchFromGitHub,
fetchpatch,

# build-system
setuptools,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 04308e4

Please sign in to comment.