From f231b7dac1accf7348b7108d8a87fd6137c2da0a Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Fri, 27 Sep 2024 07:58:55 +0200 Subject: [PATCH 1/2] python312Packages.cleanvision: init at 0.3.6 --- .../python-modules/cleanvision/default.nix | 79 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 81 insertions(+) create mode 100644 pkgs/development/python-modules/cleanvision/default.nix diff --git a/pkgs/development/python-modules/cleanvision/default.nix b/pkgs/development/python-modules/cleanvision/default.nix new file mode 100644 index 000000000000..e82ebeb52f7c --- /dev/null +++ b/pkgs/development/python-modules/cleanvision/default.nix @@ -0,0 +1,79 @@ +{ + lib, + stdenv, + buildPythonPackage, + fetchFromGitHub, + + # build-system + setuptools, + + # dependencies + fsspec, + imagehash, + matplotlib, + numpy, + pandas, + pillow, + tabulate, + tqdm, + + # tests + datasets, + psutil, + pytestCheckHook, + torchvision, +}: + +buildPythonPackage rec { + pname = "cleanvision"; + version = "0.3.6"; + pyproject = true; + + src = fetchFromGitHub { + owner = "cleanlab"; + repo = "cleanvision"; + rev = "refs/tags/v${version}"; + hash = "sha256-QAydDqLJx/jYKXqxRUElTdM5dOFA6nZag8rNAjPZjRg="; + }; + + build-system = [ setuptools ]; + + dependencies = [ + fsspec + imagehash + matplotlib + numpy + pandas + pillow + tabulate + tqdm + ]; + + pythonImportsCheck = [ "cleanvision" ]; + + nativeCheckInputs = [ + datasets + psutil + pytestCheckHook + torchvision + ]; + + preCheck = '' + export HOME=$(mktemp -d) + ''; + + disabledTests = [ + # Requires accessing s3 (online) + "test_s3_dataset" + ]; + + meta = { + description = "Automatically find issues in image datasets and practice data-centric computer vision"; + homepage = "https://github.com/cleanlab/cleanvision"; + changelog = "https://github.com/cleanlab/cleanvision/releases/tag/v${version}"; + license = lib.licenses.agpl3Only; + maintainers = with lib.maintainers; [ GaetanLepage ]; + # Fatal Python error: Aborted + broken = stdenv.isDarwin; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 4d4de65cad52..5f4c18055d16 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2282,6 +2282,8 @@ self: super: with self; { cleanlab = callPackage ../development/python-modules/cleanlab { }; + cleanvision = callPackage ../development/python-modules/cleanvision { }; + cleo = callPackage ../development/python-modules/cleo { }; clevercsv = callPackage ../development/python-modules/clevercsv { }; From cfa3385876f7cdc1785052e0c2d8573a5a68b448 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Thu, 26 Sep 2024 21:55:02 +0200 Subject: [PATCH 2/2] python312Packages.cleanlab: add missing dependency cleanvision --- pkgs/development/python-modules/cleanlab/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/python-modules/cleanlab/default.nix b/pkgs/development/python-modules/cleanlab/default.nix index d2fad3fdd220..66bcee0c48ba 100644 --- a/pkgs/development/python-modules/cleanlab/default.nix +++ b/pkgs/development/python-modules/cleanlab/default.nix @@ -14,6 +14,7 @@ pandas, # test dependencies + cleanvision, datasets, fasttext, hypothesis, @@ -58,6 +59,7 @@ buildPythonPackage rec { doCheck = true; nativeCheckInputs = [ + cleanvision datasets fasttext hypothesis