about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/torchmetrics/default.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-11-16 12:53:32 +0100
committerAlyssa Ross <hi@alyssa.is>2023-11-16 12:53:32 +0100
commit67419f0e56f99b0ebbe14574d3492110ac84c8d6 (patch)
tree3abc8e1606a2c80b6f5d14fef175e50800202163 /nixpkgs/pkgs/development/python-modules/torchmetrics/default.nix
parenta2c1eff83c3118a9aee8076c7f84f58137416b6e (diff)
parent9008bc4eb62c878d0812105ea1b34255d651df88 (diff)
downloadnixlib-67419f0e56f99b0ebbe14574d3492110ac84c8d6.tar
nixlib-67419f0e56f99b0ebbe14574d3492110ac84c8d6.tar.gz
nixlib-67419f0e56f99b0ebbe14574d3492110ac84c8d6.tar.bz2
nixlib-67419f0e56f99b0ebbe14574d3492110ac84c8d6.tar.lz
nixlib-67419f0e56f99b0ebbe14574d3492110ac84c8d6.tar.xz
nixlib-67419f0e56f99b0ebbe14574d3492110ac84c8d6.tar.zst
nixlib-67419f0e56f99b0ebbe14574d3492110ac84c8d6.zip
Merge branch 'nixos-unstable-small' of https://github.com/NixOS/nixpkgs into HEAD
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
     ];
   };
 }
-