about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/torchmetrics/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/torchmetrics/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/torchmetrics/default.nix31
1 files changed, 22 insertions, 9 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/torchmetrics/default.nix b/nixpkgs/pkgs/development/python-modules/torchmetrics/default.nix
index 85e85c16afc7..ee66ee817d1f 100644
--- a/nixpkgs/pkgs/development/python-modules/torchmetrics/default.nix
+++ b/nixpkgs/pkgs/development/python-modules/torchmetrics/default.nix
@@ -14,6 +14,8 @@
 , pytestCheckHook
 , torchmetrics
 , pytorch-lightning
+, pytest-doctestplus
+, pytest-xdist
 }:
 
 let
@@ -22,10 +24,11 @@ let
 in
 buildPythonPackage {
   inherit pname version;
+  pyproject = true;
 
   src = fetchFromGitHub {
-    owner = "PyTorchLightning";
-    repo = "metrics";
+    owner = "Lightning-AI";
+    repo = "torchmetrics";
     rev = "refs/tags/v${version}";
     hash = "sha256-g5JuTbiRd8yWx2nM3UE8ejOhuZ0XpAQdS5AC9AlrSFY=";
   };
@@ -51,22 +54,33 @@ buildPythonPackage {
     cloudpickle
     psutil
     pytestCheckHook
+    pytest-doctestplus
+    pytest-xdist
   ];
 
   # A cyclic dependency in: integrations/test_lightning.py
   doCheck = false;
   passthru.tests.check = torchmetrics.overridePythonAttrs (_: {
+    pname = "${pname}-check";
     doCheck = true;
+    # We don't have to install because the only purpose
+    # of this passthru test is to, well, test.
+    # This fixes having to set `catchConflicts` to false.
+    dontInstall = true;
   });
 
+  disabledTests = [
+    # `IndexError: list index out of range`
+    "test_metric_lightning_log"
+  ];
+
   disabledTestPaths = [
     # These require too many "leftpad-level" dependencies
-    "tests/text"
-    "tests/audio"
-    "tests/image"
+    # Also too cross-dependent
+    "tests/unittests"
 
-    # A few non-deterministic things like test_check_compute_groups_is_faster
-    "tests/bases/test_collections.py"
+    # A trillion import path mismatch errors
+    "src/torchmetrics"
   ];
 
   pythonImportsCheck = [
@@ -75,11 +89,10 @@ buildPythonPackage {
 
   meta = with lib; {
     description = "Machine learning metrics for distributed, scalable PyTorch applications (used in pytorch-lightning)";
-    homepage = "https://torchmetrics.readthedocs.io";
+    homepage = "https://lightning.ai/docs/torchmetrics/";
     license = licenses.asl20;
     maintainers = with maintainers; [
       SomeoneSerge
     ];
   };
 }
-