From 9939d8cb2203aac2ef5da05742ebc3c53d551dae Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Fri, 4 Apr 2025 21:59:57 -0400 Subject: [PATCH] python312Packages.captum: 0.7.0 -> 0.8.0 Signed-off-by: Ihar Hrachyshka --- .../python-modules/captum/default.nix | 40 +++++++------------ 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/pkgs/development/python-modules/captum/default.nix b/pkgs/development/python-modules/captum/default.nix index e85901a65905..a39f00634ac4 100644 --- a/pkgs/development/python-modules/captum/default.nix +++ b/pkgs/development/python-modules/captum/default.nix @@ -2,7 +2,7 @@ lib, stdenv, fetchFromGitHub, - pythonOlder, + fetchpatch, buildPythonPackage, pytestCheckHook, setuptools, @@ -13,11 +13,13 @@ tqdm, flask, flask-compress, + parameterized, + scikit-learn, }: buildPythonPackage rec { pname = "captum"; - version = "0.7.0"; + version = "0.8.0"; pyproject = true; build-system = [ setuptools ]; @@ -26,7 +28,7 @@ buildPythonPackage rec { owner = "pytorch"; repo = "captum"; tag = "v${version}"; - hash = "sha256-1VOvPqxn6CNnmv7M8fl7JrqRfJQUH2tnXRCUqKnl7i0="; + hash = "sha256-WuKbMYZPHWaTYYhVseSSkwXQk9LBzGuWfmneDw9V2hg="; }; dependencies = [ @@ -37,36 +39,24 @@ buildPythonPackage rec { tqdm ]; + pythonRelaxDeps = [ + "numpy" + ]; + pythonImportsCheck = [ "captum" ]; nativeCheckInputs = [ pytestCheckHook flask flask-compress + parameterized + scikit-learn ]; disabledTestPaths = - [ - # These tests requires `parametrized` module (https://pypi.org/project/parametrized/) which seem to be unavailable on Nix. - "tests/attr/test_dataloader_attr.py" - "tests/attr/test_interpretable_input.py" - "tests/attr/test_llm_attr.py" - "tests/influence/_core/test_dataloader.py" - "tests/influence/_core/test_tracin_aggregate_influence.py" - "tests/influence/_core/test_tracin_intermediate_quantities.py" - "tests/influence/_core/test_tracin_k_most_influential.py" - "tests/influence/_core/test_tracin_regression.py" - "tests/influence/_core/test_tracin_self_influence.py" - "tests/influence/_core/test_tracin_show_progress.py" - "tests/influence/_core/test_tracin_validation.py" - "tests/influence/_core/test_tracin_xor.py" - "tests/insights/test_contribution.py" - "tests/module/test_binary_concrete_stochastic_gates.py" - "tests/module/test_gaussian_stochastic_gates.py" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # These tests are failing on macOS: - # > E AttributeError: module 'torch.distributed' has no attribute 'init_process_group' + lib.optionals stdenv.hostPlatform.isDarwin [ + # These tests may fail if multiple builds run them at the same time due + # to hardcoded port number used for rendezvous "tests/attr/test_data_parallel.py" ] ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ @@ -76,8 +66,8 @@ buildPythonPackage rec { disabledTests = [ # Failing tests - "test_softmax_classification_batch_multi_target" "test_softmax_classification_batch_zero_baseline" + "test_tracin_identity_regression_9_check_idx_none_ArnoldiInfluenceFunction" ]; meta = {