From ddeadc2f1cf0e19eec4dd3dcf2ebb5de0bf118b0 Mon Sep 17 00:00:00 2001 From: Lein Matsumaru Date: Sun, 31 May 2026 10:26:03 +0000 Subject: [PATCH] python3Packages.pims: fix tests --- .../python-modules/pims/default.nix | 43 +++++++++++++++---- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/pims/default.nix b/pkgs/development/python-modules/pims/default.nix index 402c179fe749..ceef7d95cecb 100644 --- a/pkgs/development/python-modules/pims/default.nix +++ b/pkgs/development/python-modules/pims/default.nix @@ -7,30 +7,54 @@ pytestCheckHook, scikit-image, slicerator, + packaging, + tifffile, + jinja2, + jpype1, + matplotlib, + moviepy, + setuptools, }: -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "pims"; version = "0.7"; - format = "setuptools"; + pyproject = true; src = fetchFromGitHub { owner = "soft-matter"; repo = "pims"; - tag = "v${version}"; + tag = "v${finalAttrs.version}"; hash = "sha256-3SBZk11w6eTZFmETMRJaYncxY38CYne1KzoF5oRgzuY="; }; - propagatedBuildInputs = [ + build-system = [ + setuptools + ]; + + dependencies = [ slicerator imageio numpy + packaging + tifffile # imported within try-excet block so optional but setup.py requires it. ]; + optional-dependencies = { + # CI says its extras + extras = [ + jinja2 + jpype1 + matplotlib + moviepy + scikit-image + ]; + }; + nativeCheckInputs = [ pytestCheckHook - scikit-image - ]; + ] + ++ finalAttrs.passthru.optional-dependencies.extras; pythonImportsCheck = [ "pims" ]; @@ -46,13 +70,16 @@ buildPythonPackage rec { disabledTestPaths = [ # AssertionError: Tuples differ: (377, 505, 4) != (384, 512, 4) "pims/tests/test_display.py" + + # tests require internet connection + "pims/tests/test_bioformats.py" ]; meta = { description = "Module to load video and sequential images in various formats"; homepage = "https://github.com/soft-matter/pims"; - changelog = "https://github.com/soft-matter/pims/releases/tag/v${version}"; + changelog = "https://github.com/soft-matter/pims/releases/tag/v${finalAttrs.version}"; license = lib.licenses.bsd3; maintainers = [ ]; }; -} +})