From d4628d9dd5cf3df2398f8445487c8e1771ae2dfc Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Sun, 8 Mar 2026 12:53:39 +0000 Subject: [PATCH] python3Packages.torchmetrics: 1.8.2 -> 1.9.0 Diff: https://github.com/Lightning-AI/torchmetrics/compare/v1.8.2...v1.9.0 Changelog: https://github.com/Lightning-AI/torchmetrics/releases/tag/v1.9.0 --- .../python-modules/torchmetrics/default.nix | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/torchmetrics/default.nix b/pkgs/development/python-modules/torchmetrics/default.nix index e376fe6fbed8..b6e5587d6039 100644 --- a/pkgs/development/python-modules/torchmetrics/default.nix +++ b/pkgs/development/python-modules/torchmetrics/default.nix @@ -12,26 +12,28 @@ torch, # tests + ipython, pytestCheckHook, pytest-doctestplus, pytest-xdist, pytorch-lightning, scikit-image, + transformers, # passthru torchmetrics, }: -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "torchmetrics"; - version = "1.8.2"; + version = "1.9.0"; pyproject = true; src = fetchFromGitHub { owner = "Lightning-AI"; repo = "torchmetrics"; - tag = "v${version}"; - hash = "sha256-OsU2JpKcbe1AuSIAyZLjDpFdsSk2q3kMGBcNXtIJm3Q="; + tag = "v${finalAttrs.version}"; + hash = "sha256-jlIZQWu0lE37Gv0Rzmgm+kG3dEeT1p3pKdXzkUgq3Rw="; }; dependencies = [ @@ -44,17 +46,19 @@ buildPythonPackage rec { buildInputs = [ torch ]; nativeCheckInputs = [ + ipython pytestCheckHook pytest-doctestplus pytest-xdist pytorch-lightning scikit-image + transformers ]; # A cyclic dependency in: integrations/test_lightning.py doCheck = false; passthru.tests.check = torchmetrics.overridePythonAttrs (_: { - pname = "${pname}-check"; + pname = "${finalAttrs.pname}-check"; doCheck = true; # We don't have to install because the only purpose # of this passthru test is to, well, test. @@ -62,6 +66,11 @@ buildPythonPackage rec { dontInstall = true; }); + pytestFlags = [ + # The (path: py.path.local) argument is deprecated, please use (file_path: pathlib.Path) + "-Wignore::pytest.PytestRemovedIn9Warning" + ]; + disabledTestPaths = [ # These require too many "leftpad-level" dependencies # Also too cross-dependent @@ -71,8 +80,9 @@ buildPythonPackage rec { "examples/audio/pesq.py" # Require internet access - "examples/text/bertscore.py" + "examples/audio/text_to_speech.py" "examples/image/clip_score.py" + "examples/text/bertscore.py" "examples/text/perplexity.py" "examples/text/rouge.py" @@ -85,8 +95,8 @@ buildPythonPackage rec { meta = { description = "Machine learning metrics for distributed, scalable PyTorch applications (used in pytorch-lightning)"; homepage = "https://lightning.ai/docs/torchmetrics/"; - changelog = "https://github.com/Lightning-AI/torchmetrics/releases/tag/v${version}"; + changelog = "https://github.com/Lightning-AI/torchmetrics/releases/tag/${finalAttrs.src.tag}"; license = lib.licenses.asl20; maintainers = with lib.maintainers; [ SomeoneSerge ]; }; -} +})