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