1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 6 # build-system 7 setuptools, 8 9 # dependencies 10 numpy, 11 scikit-learn, 12 termcolor, 13 tqdm, 14 pandas, 15 16 # tests 17 cleanvision, 18 datasets, 19 fasttext, 20 hypothesis, 21 keras, 22 matplotlib, 23 pytestCheckHook, 24 pytest-lazy-fixture, 25 skorch, 26 tensorflow, 27 torch, 28 torchvision, 29 wget, 30 pythonAtLeast, 31}: 32 33buildPythonPackage rec { 34 pname = "cleanlab"; 35 version = "2.7.1"; 36 pyproject = true; 37 38 src = fetchFromGitHub { 39 owner = "cleanlab"; 40 repo = "cleanlab"; 41 tag = "v${version}"; 42 hash = "sha256-KzVqBOLTxxkgvoGPYMeYb7zMuG8VwQwX6SYR/FUhfBw="; 43 }; 44 45 build-system = [ setuptools ]; 46 47 pythonRelaxDeps = [ 48 "numpy" 49 ]; 50 51 dependencies = [ 52 numpy 53 scikit-learn 54 termcolor 55 tqdm 56 pandas 57 ]; 58 59 # This is ONLY turned off when we have testing enabled. 60 # The reason we do this is because of duplicate packages in the enclosure 61 # when using the packages in nativeCheckInputs. 62 # Affected packages: grpcio protobuf tensorboard tensorboard-plugin-profile 63 catchConflicts = (!doCheck); 64 doCheck = true; 65 66 nativeCheckInputs = [ 67 cleanvision 68 datasets 69 fasttext 70 hypothesis 71 keras 72 matplotlib 73 pytestCheckHook 74 pytest-lazy-fixture 75 skorch 76 tensorflow 77 torch 78 torchvision 79 wget 80 ]; 81 82 disabledTests = 83 [ 84 # Requires the datasets we prevent from downloading 85 "test_create_imagelab" 86 87 # Non-trivial numpy2 incompatibilities 88 # assert np.float64(0.492) == 0.491 89 "test_duplicate_points_have_similar_scores" 90 # AssertionError: assert 'Annotators [1] did not label any examples.' 91 "test_label_quality_scores_multiannotator" 92 ] 93 ++ lib.optionals (pythonAtLeast "3.12") [ 94 # AttributeError: 'called_once_with' is not a valid assertion. 95 # Use a spec for the mock if 'called_once_with' is meant to be an attribute.. 96 # Did you mean: 'assert_called_once_with'? 97 "test_custom_issue_manager_not_registered" 98 ]; 99 100 disabledTestPaths = [ 101 # Requires internet 102 "tests/test_dataset.py" 103 # Requires the datasets we just prevented from downloading 104 "tests/datalab/test_cleanvision_integration.py" 105 # Fails because of issues with the keras derivation 106 "tests/test_frameworks.py" 107 ]; 108 109 meta = { 110 description = "Standard data-centric AI package for data quality and machine learning with messy, real-world data and labels"; 111 homepage = "https://github.com/cleanlab/cleanlab"; 112 changelog = "https://github.com/cleanlab/cleanlab/releases/tag/v${version}"; 113 license = lib.licenses.agpl3Only; 114 maintainers = with lib.maintainers; [ happysalada ]; 115 }; 116}