0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 21:50:33 +03:00

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

This commit is contained in:
Gaétan Lepage 2025-05-23 19:58:53 +02:00 committed by GitHub
commit 3765ba2acf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,10 +1,9 @@
{
stdenv,
lib,
stdenv,
config,
buildPythonPackage,
fetchFromGitHub,
isPy27,
config,
# build-system
setuptools,
@ -20,9 +19,11 @@
tensorboard,
# tests
cudaSupport ? config.cudaSupport,
pytestCheckHook,
torchvision,
writableTmpDirAsHomeHook,
cudaSupport ? config.cudaSupport,
}:
buildPythonPackage rec {
@ -30,11 +31,9 @@ buildPythonPackage rec {
version = "2.8.1";
pyproject = true;
disabled = isPy27;
src = fetchFromGitHub {
owner = "KevinMusgrave";
repo = pname;
repo = "pytorch-metric-learning";
tag = "v${version}";
hash = "sha256-WO/gv8rKkxY3pR627WrEPVyvZnvUZIKMzOierIW8bJA=";
};
@ -64,7 +63,6 @@ buildPythonPackage rec {
};
preCheck = ''
export HOME=$TMP
export TEST_DEVICE=cpu
export TEST_DTYPES=float32,float64 # half-precision tests fail on CPU
'';
@ -73,6 +71,7 @@ buildPythonPackage rec {
nativeCheckInputs = [
pytestCheckHook
torchvision
writableTmpDirAsHomeHook
] ++ lib.flatten (lib.attrValues optional-dependencies);
disabledTests =
@ -100,6 +99,12 @@ buildPythonPackage rec {
"test_with_same_parent_label_tester"
];
disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [
# Fatal Python error: Segmentation fault
"tests/testers/"
"tests/utils/"
];
meta = {
description = "Metric learning library for PyTorch";
homepage = "https://github.com/KevinMusgrave/pytorch-metric-learning";