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"; diff --git a/pkgs/development/python-modules/pydicom/default.nix b/pkgs/development/python-modules/pydicom/default.nix index 0a8ca2dcf87c..933f58295a9c 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,16 +105,8 @@ 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 = [ - # > 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 - ]; }; -} +})