python312Packages.pytorch-metric-learning: cleanup, fix on darwin (#410143)

authored by Gaétan Lepage and committed by GitHub 3765ba2a 980ae985

+13 -8
+13 -8
pkgs/development/python-modules/pytorch-metric-learning/default.nix
··· 1 1 { 2 + lib, 2 3 stdenv, 3 - lib, 4 + config, 4 5 buildPythonPackage, 5 6 fetchFromGitHub, 6 - isPy27, 7 - config, 8 7 9 8 # build-system 10 9 setuptools, ··· 20 19 tensorboard, 21 20 22 21 # tests 23 - cudaSupport ? config.cudaSupport, 24 22 pytestCheckHook, 25 23 torchvision, 24 + writableTmpDirAsHomeHook, 25 + 26 + cudaSupport ? config.cudaSupport, 26 27 }: 27 28 28 29 buildPythonPackage rec { 29 30 pname = "pytorch-metric-learning"; 30 31 version = "2.8.1"; 31 32 pyproject = true; 32 - 33 - disabled = isPy27; 34 33 35 34 src = fetchFromGitHub { 36 35 owner = "KevinMusgrave"; 37 - repo = pname; 36 + repo = "pytorch-metric-learning"; 38 37 tag = "v${version}"; 39 38 hash = "sha256-WO/gv8rKkxY3pR627WrEPVyvZnvUZIKMzOierIW8bJA="; 40 39 }; ··· 64 63 }; 65 64 66 65 preCheck = '' 67 - export HOME=$TMP 68 66 export TEST_DEVICE=cpu 69 67 export TEST_DTYPES=float32,float64 # half-precision tests fail on CPU 70 68 ''; ··· 73 71 nativeCheckInputs = [ 74 72 pytestCheckHook 75 73 torchvision 74 + writableTmpDirAsHomeHook 76 75 ] ++ lib.flatten (lib.attrValues optional-dependencies); 77 76 78 77 disabledTests = ··· 99 98 "test_tied_distances" 100 99 "test_with_same_parent_label_tester" 101 100 ]; 101 + 102 + disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [ 103 + # Fatal Python error: Segmentation fault 104 + "tests/testers/" 105 + "tests/utils/" 106 + ]; 102 107 103 108 meta = { 104 109 description = "Metric learning library for PyTorch";