From 0466b7dee3560ec56f6a7cd23d5fa515d0ff8c09 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Tue, 25 Mar 2025 23:57:19 +0100 Subject: [PATCH] python312Packages.compressed-tensors: disable failing tests on darwin --- .../compressed-tensors/default.nix | 32 ++++++++++++------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/pkgs/development/python-modules/compressed-tensors/default.nix b/pkgs/development/python-modules/compressed-tensors/default.nix index c37387e9ae76..3dd16d37e9f7 100644 --- a/pkgs/development/python-modules/compressed-tensors/default.nix +++ b/pkgs/development/python-modules/compressed-tensors/default.nix @@ -1,5 +1,6 @@ { lib, + stdenv, buildPythonPackage, fetchFromGitHub, setuptools, @@ -19,7 +20,7 @@ buildPythonPackage rec { # Release on PyPI is missing the `utils` directory, which `setup.py` wants to import src = fetchFromGitHub { owner = "neuralmagic"; - repo = pname; + repo = "compressed-tensors"; tag = version; hash = "sha256-PxW8zseDUF0EOh7E/N8swwgFTfvkoTpp+d3ngAUpFNU="; }; @@ -42,25 +43,32 @@ buildPythonPackage rec { pytestCheckHook ]; - disabledTests = [ - # these try to download models from HF Hub - "test_get_observer_token_count" - "test_kv_cache_quantization" - "test_target_prioritization" - "test_load_compressed_sharded" - "test_save_compressed_model" - "test_apply_tinyllama_dynamic_activations" - ]; + disabledTests = + [ + # these try to download models from HF Hub + "test_get_observer_token_count" + "test_kv_cache_quantization" + "test_target_prioritization" + "test_load_compressed_sharded" + "test_save_compressed_model" + "test_apply_tinyllama_dynamic_activations" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # No module named 'torch._C._distributed_c10d'; 'torch._C' is not a package + "test_composability" + "test_missing_and_unexpected_keys_on_compression" + ]; disabledTestPaths = [ # these try to download models from HF Hub "tests/test_quantization/lifecycle/test_apply.py" ]; - meta = with lib; { + meta = { description = "A safetensors extension to efficiently store sparse quantized tensors on disk"; homepage = "https://github.com/neuralmagic/compressed-tensors"; - license = licenses.asl20; + changelog = "https://github.com/neuralmagic/compressed-tensors/releases/tag/${version}"; + license = lib.licenses.asl20; maintainers = [ ]; }; }