From 369c2bd492209bb8cbb28cdf4504fefb4b1cc53f Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Thu, 15 Jan 2026 08:34:38 +0000 Subject: [PATCH 1/3] python3Packages.pydicom: use finalAttrs pattern --- pkgs/development/python-modules/pydicom/default.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/pydicom/default.nix b/pkgs/development/python-modules/pydicom/default.nix index 0a8ca2dcf87c..0d8e5cd4fae0 100644 --- a/pkgs/development/python-modules/pydicom/default.nix +++ b/pkgs/development/python-modules/pydicom/default.nix @@ -26,7 +26,7 @@ let hash = "sha256-ji7SppKdiszaXs8yCSIPkJj4Ld++XWNw9FuxLoFLfFo="; }; in -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "pydicom"; version = "3.0.1"; pyproject = true; @@ -34,7 +34,7 @@ buildPythonPackage rec { src = fetchFromGitHub { owner = "pydicom"; repo = "pydicom"; - tag = "v${version}"; + tag = "v${finalAttrs.version}"; hash = "sha256-SvRevQehRaSp+vCtJRQVEJiC5noIJS+bGG1/q4p7/XU="; }; @@ -60,7 +60,7 @@ buildPythonPackage rec { pytestCheckHook writableTmpDirAsHomeHook ] - ++ optional-dependencies.pixeldata; + ++ finalAttrs.passthru.optional-dependencies.pixeldata; passthru.pydicom-data = test_data; @@ -105,7 +105,7 @@ buildPythonPackage rec { description = "Python package for working with DICOM files"; mainProgram = "pydicom"; homepage = "https://pydicom.github.io"; - changelog = "https://github.com/pydicom/pydicom/releases/tag/v${version}"; + changelog = "https://github.com/pydicom/pydicom/releases/tag/${finalAttrs.src.tag}"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ bcdarwin ]; badPlatforms = [ @@ -117,4 +117,4 @@ buildPythonPackage rec { lib.systems.inspect.patterns.isDarwin ]; }; -} +}) From 7a6e1c1b2b3059790923104d2cccf335d56a44a5 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Thu, 15 Jan 2026 08:35:54 +0000 Subject: [PATCH 2/3] python3Packages.pydicom: enable on darwin --- pkgs/development/python-modules/pydicom/default.nix | 8 -------- 1 file changed, 8 deletions(-) diff --git a/pkgs/development/python-modules/pydicom/default.nix b/pkgs/development/python-modules/pydicom/default.nix index 0d8e5cd4fae0..933f58295a9c 100644 --- a/pkgs/development/python-modules/pydicom/default.nix +++ b/pkgs/development/python-modules/pydicom/default.nix @@ -108,13 +108,5 @@ buildPythonPackage (finalAttrs: { changelog = "https://github.com/pydicom/pydicom/releases/tag/${finalAttrs.src.tag}"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ bcdarwin ]; - badPlatforms = [ - # > 200 tests are failing with errors like: - # AttributeError: 'FileDataset' object has no attribute 'BitsStored' - # AttributeError: 'FileDataset' object has no attribute 'Rows' - # AttributeError: The dataset has no 'Pixel Data', 'Float Pixel Data' or 'Double Float Pixel Data' element, no pixel data to decode - # pydicom.errors.InvalidDicomError: File is missing DICOM File Meta Information header or the 'DICM' prefix is missing from the header. - lib.systems.inspect.patterns.isDarwin - ]; }; }) From bca3dcb30cfacf2572b25c3c46b963c7de49350e Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Thu, 15 Jan 2026 08:36:39 +0000 Subject: [PATCH 3/3] python3Packages.nibabel: cleanup, fix --- .../python-modules/nibabel/default.nix | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/pkgs/development/python-modules/nibabel/default.nix b/pkgs/development/python-modules/nibabel/default.nix index 478e69bcd5c8..0873da577050 100644 --- a/pkgs/development/python-modules/nibabel/default.nix +++ b/pkgs/development/python-modules/nibabel/default.nix @@ -5,17 +5,25 @@ fetchpatch2, pythonAtLeast, pythonOlder, - hatchling, + + # build-system hatch-vcs, + hatchling, + + # dependencies numpy, packaging, importlib-resources, typing-extensions, + + # optional-dependencies pydicom, pillow, h5py, scipy, - git, + + addBinToPathHook, + gitMinimal, pytest-doctestplus, pytest-httpserver, pytest-xdist, @@ -42,8 +50,8 @@ buildPythonPackage (finalAttrs: { ]; build-system = [ - hatchling hatch-vcs + hatchling ]; dependencies = [ @@ -53,19 +61,20 @@ buildPythonPackage (finalAttrs: { ++ lib.optionals (pythonOlder "3.12") [ importlib-resources ] ++ lib.optionals (pythonOlder "3.13") [ typing-extensions ]; - optional-dependencies = rec { - all = dicom ++ dicomfs ++ minc2 ++ spm ++ zstd; + optional-dependencies = lib.fix (self: { + all = self.dicom ++ self.dicomfs ++ self.minc2 ++ self.spm ++ self.zstd; dicom = [ pydicom ]; - dicomfs = [ pillow ] ++ dicom; + dicomfs = [ pillow ] ++ self.dicom; minc2 = [ h5py ]; spm = [ scipy ]; zstd = [ # TODO: pyzstd ]; - }; + }); nativeCheckInputs = [ - git + addBinToPathHook + gitMinimal pytest-doctestplus pytest-httpserver pytest-xdist @@ -78,10 +87,6 @@ buildPythonPackage (finalAttrs: { "test_deprecator_maker" ]; - preCheck = '' - export PATH=$out/bin:$PATH - ''; - meta = { homepage = "https://nipy.org/nibabel"; changelog = "https://github.com/nipy/nibabel/blob/${finalAttrs.version}/Changelog";