From 1f801ba1a00344385539250386effef3f64632ca Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Mon, 17 Feb 2025 10:40:43 +0100 Subject: [PATCH 01/10] python312Packages.nilearn: cleanup & fix --- .../python-modules/nilearn/default.nix | 63 ++++++++++++------- 1 file changed, 42 insertions(+), 21 deletions(-) diff --git a/pkgs/development/python-modules/nilearn/default.nix b/pkgs/development/python-modules/nilearn/default.nix index 63a3fd62c2f3..d3eb405a138a 100644 --- a/pkgs/development/python-modules/nilearn/default.nix +++ b/pkgs/development/python-modules/nilearn/default.nix @@ -1,19 +1,24 @@ { lib, buildPythonPackage, - fetchPypi, - pythonOlder, - pytestCheckHook, + fetchFromGitHub, + + # build-system hatch-vcs, + hatchling, + + # dependencies + joblib, lxml, - matplotlib, nibabel, numpy, pandas, + requests, scikit-learn, scipy, - joblib, - requests, + packaging, + + pytestCheckHook, }: buildPythonPackage rec { @@ -21,36 +26,52 @@ buildPythonPackage rec { version = "0.11.1"; pyproject = true; - disabled = pythonOlder "3.8"; - - src = fetchPypi { - inherit pname version; - hash = "sha256-oB3wj8bI3tPNb7eiEWNGA61Gpt94BQS20FIiwuepcv4="; + src = fetchFromGitHub { + owner = "nilearn"; + repo = "nilearn"; + tag = version; + hash = "sha256-ZvodSRJkKwPwpYHOLmxAYIIv7f9AlrjmZS9KLPjz5rM="; }; - nativeBuildInputs = [ hatch-vcs ]; + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail " --template=maint_tools/templates/index.html" "" + ''; - nativeCheckInputs = [ pytestCheckHook ]; - disabledTests = [ "test_clean_confounds" ]; # https://github.com/nilearn/nilearn/issues/2608 - # do subset of tests which don't fetch resources - pytestFlagsArray = [ "nilearn/connectome/tests" ]; + build-system = [ + hatch-vcs + hatchling + ]; - propagatedBuildInputs = [ + dependencies = [ joblib lxml - matplotlib nibabel numpy pandas requests scikit-learn scipy + packaging ]; - meta = with lib; { - homepage = "https://nilearn.github.io"; + nativeCheckInputs = [ pytestCheckHook ]; + + disabledTests = [ + # https://github.com/nilearn/nilearn/issues/2608 + "test_clean_confounds" + + # [XPASS(strict)] invalid checks should fail + "test_check_estimator_invalid_group_sparse_covariance" + ]; + + # do subset of tests which don't fetch resources + pytestFlagsArray = [ "nilearn/connectome/tests" ]; + + meta = { description = "Module for statistical learning on neuroimaging data"; + homepage = "https://nilearn.github.io"; changelog = "https://github.com/nilearn/nilearn/releases/tag/${version}"; - license = licenses.bsd3; + license = lib.licenses.bsd3; }; } From 3b4488d5d55d4b7382022fef16ab98dfcbcce182 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Mon, 17 Feb 2025 10:41:56 +0100 Subject: [PATCH 02/10] python312Packages.nilearn: add GaetanLepage to as maintainer --- pkgs/development/python-modules/nilearn/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/python-modules/nilearn/default.nix b/pkgs/development/python-modules/nilearn/default.nix index d3eb405a138a..535321edb909 100644 --- a/pkgs/development/python-modules/nilearn/default.nix +++ b/pkgs/development/python-modules/nilearn/default.nix @@ -73,5 +73,6 @@ buildPythonPackage rec { homepage = "https://nilearn.github.io"; changelog = "https://github.com/nilearn/nilearn/releases/tag/${version}"; license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ GaetanLepage ]; }; } From e331616f171da38addbf8230f9f8c6c5fc2972da Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Mon, 17 Feb 2025 11:04:26 +0100 Subject: [PATCH 03/10] python312Packages.acres: init at 0.2.0 --- .../python-modules/acres/default.nix | 45 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 47 insertions(+) create mode 100644 pkgs/development/python-modules/acres/default.nix diff --git a/pkgs/development/python-modules/acres/default.nix b/pkgs/development/python-modules/acres/default.nix new file mode 100644 index 000000000000..666299b4dd31 --- /dev/null +++ b/pkgs/development/python-modules/acres/default.nix @@ -0,0 +1,45 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + pdm-backend, + importlib-resources, + pytestCheckHook, +}: + +buildPythonPackage rec { + pname = "acres"; + version = "0.2.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "nipreps"; + repo = "acres"; + tag = version; + hash = "sha256-DSDTOUNInLMR6C1P4NT+121sU+BYBLw67xRCtKobEaM="; + }; + + build-system = [ + pdm-backend + ]; + + dependencies = [ + importlib-resources + ]; + + pythonImportsCheck = [ + "acres" + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + meta = { + description = "Data-loading utility for Python"; + homepage = "https://github.com/nipreps/acres"; + changelog = "https://github.com/nipreps/acres/blob/${version}/CHANGELOG.md"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ GaetanLepage ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index e702b2102235..9dfa577307f2 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -51,6 +51,8 @@ self: super: with self; { acquire = callPackage ../development/python-modules/acquire { }; + acres = callPackage ../development/python-modules/acres { }; + actdiag = callPackage ../development/python-modules/actdiag { }; acunetix = callPackage ../development/python-modules/acunetix { }; From 68f695de67334f3bf1bfb81a91c495aaf88c5afd Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Mon, 17 Feb 2025 10:53:41 +0100 Subject: [PATCH 04/10] python312Packages.niworkflows: 1.12.0 -> 1.12.2 Diff: https://github.com/nipreps/niworkflows/compare/refs/tags/1.12.0...1.12.2 Changelog: https://github.com/nipreps/niworkflows/blob/1.12.2/CHANGES.rst --- .../python-modules/niworkflows/default.nix | 46 +++++++++++++------ 1 file changed, 33 insertions(+), 13 deletions(-) diff --git a/pkgs/development/python-modules/niworkflows/default.nix b/pkgs/development/python-modules/niworkflows/default.nix index 05e21f2834ab..5811062df376 100644 --- a/pkgs/development/python-modules/niworkflows/default.nix +++ b/pkgs/development/python-modules/niworkflows/default.nix @@ -2,9 +2,13 @@ lib, buildPythonPackage, fetchFromGitHub, + + # build-system hatch-vcs, hatchling, - pytestCheckHook, + + # dependencies + acres, attrs, importlib-resources, jinja2, @@ -26,18 +30,24 @@ templateflow, traits, transforms3d, + + # tests + pytest-cov-stub, + pytest-env, + pytestCheckHook, + writableTmpDirAsHomeHook, }: buildPythonPackage rec { pname = "niworkflows"; - version = "1.12.0"; + version = "1.12.2"; pyproject = true; src = fetchFromGitHub { owner = "nipreps"; repo = "niworkflows"; tag = version; - hash = "sha256-OWsfz5YDPy1qPpXomr4YiuCDf40Fy1pW8cNHPjHfqp4="; + hash = "sha256-rgnfp12SHlL3LFFMSrHlTd0tWNnA4ekxZ9kKYRvZWlw="; }; pythonRelaxDeps = [ "traits" ]; @@ -48,6 +58,7 @@ buildPythonPackage rec { ]; dependencies = [ + acres attrs importlib-resources jinja2 @@ -73,29 +84,38 @@ buildPythonPackage rec { env.SETUPTOOLS_SCM_PRETEND_VERSION = version; - nativeCheckInputs = [ pytestCheckHook ]; - preCheck = ''export HOME=$(mktemp -d)''; + nativeCheckInputs = [ + pytest-cov-stub + pytest-env + pytestCheckHook + writableTmpDirAsHomeHook + ]; + pytestFlagsArray = [ "niworkflows" ]; - # try to download data: + disabledTests = [ - "test_GenerateCifti" + # try to download data: "ROIsPlot" "ROIsPlot2" + "niworkflows.interfaces.cifti._prepare_cifti" + "niworkflows.utils.misc.get_template_specs" + "test_GenerateCifti" "test_SimpleShowMaskRPT" "test_cifti_surfaces_plot" - "niworkflows.utils.misc.get_template_specs" - "niworkflows.interfaces.cifti._prepare_cifti" ]; - disabledTestPaths = [ "niworkflows/tests/test_registration.py" ]; + + disabledTestPaths = [ + "niworkflows/tests/test_registration.py" + ]; pythonImportsCheck = [ "niworkflows" ]; - meta = with lib; { + meta = { description = "Common workflows for MRI (anatomical, functional, diffusion, etc.)"; mainProgram = "niworkflows-boldref"; homepage = "https://github.com/nipreps/niworkflows"; changelog = "https://github.com/nipreps/niworkflows/blob/${src.tag}/CHANGES.rst"; - license = licenses.asl20; - maintainers = with maintainers; [ bcdarwin ]; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ bcdarwin ]; }; } From a795c06ab7e9c66d5ec7c7377ce6649968604b2b Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Mon, 17 Feb 2025 11:52:56 +0100 Subject: [PATCH 05/10] python312Packaegs.pydicom: cleanup & mark as broken on darwin --- .../python-modules/pydicom/default.nix | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/pkgs/development/python-modules/pydicom/default.nix b/pkgs/development/python-modules/pydicom/default.nix index 13fbb8e4d0d5..f1c42f7579c9 100644 --- a/pkgs/development/python-modules/pydicom/default.nix +++ b/pkgs/development/python-modules/pydicom/default.nix @@ -3,7 +3,6 @@ stdenv, buildPythonPackage, fetchFromGitHub, - pythonOlder, flit-core, numpy, pytestCheckHook, @@ -11,8 +10,8 @@ # optional/test dependencies gdcm, pillow, - pylibjpeg, pylibjpeg-libjpeg, + writableTmpDirAsHomeHook, }: let # Pydicom needs pydicom-data to run some tests. If these files aren't downloaded @@ -29,8 +28,6 @@ buildPythonPackage rec { version = "3.0.1"; pyproject = true; - disabled = pythonOlder "3.10"; - src = fetchFromGitHub { owner = "pydicom"; repo = "pydicom"; @@ -55,13 +52,15 @@ buildPythonPackage rec { ]; }; - nativeCheckInputs = [ pytestCheckHook ] ++ optional-dependencies.pixeldata; + nativeCheckInputs = [ + pytestCheckHook + writableTmpDirAsHomeHook + ] ++ optional-dependencies.pixeldata; # Setting $HOME to prevent pytest to try to create a folder inside # /homeless-shelter which is read-only. # Linking pydicom-data dicom files to $HOME/.pydicom/data preCheck = '' - export HOME=$TMP/test-home mkdir -p $HOME/.pydicom/ ln -s ${test_data}/data_store/data $HOME/.pydicom/data ''; @@ -90,12 +89,20 @@ buildPythonPackage rec { pythonImportsCheck = [ "pydicom" ]; - meta = with lib; { + meta = { 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}"; - license = licenses.mit; - maintainers = with maintainers; [ bcdarwin ]; + 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 6412c1cc6ddfacf62b8ac8e875fd718d64a70943 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Mon, 17 Feb 2025 13:21:22 +0100 Subject: [PATCH 06/10] python312Packages.pyorthanc: 1.19.0 -> 1.19.1 Diff: https://github.com/gacou54/pyorthanc/compare/refs/tags/v1.19.0...v1.19.1 Changelog: https://github.com/gacou54/pyorthanc/releases/tag/v1.19.1 --- .../python-modules/pyorthanc/default.nix | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/pkgs/development/python-modules/pyorthanc/default.nix b/pkgs/development/python-modules/pyorthanc/default.nix index 09ef97b0b058..3e84ec6edf34 100644 --- a/pkgs/development/python-modules/pyorthanc/default.nix +++ b/pkgs/development/python-modules/pyorthanc/default.nix @@ -2,7 +2,6 @@ lib, buildPythonPackage, fetchFromGitHub, - pythonOlder, poetry-core, httpx, pydicom, @@ -10,20 +9,23 @@ buildPythonPackage rec { pname = "pyorthanc"; - version = "1.19.0"; - disabled = pythonOlder "3.8"; + version = "1.19.1"; pyproject = true; src = fetchFromGitHub { owner = "gacou54"; - repo = pname; + repo = "pyorthanc"; tag = "v${version}"; - hash = "sha256-6//kmkurtaXRGvnYnk/kU2j9F6V1Aui6IEdl+3DHGH0="; + hash = "sha256-97i341NXb7QsgN0X808mtz1rSKYSP+SMoGJy43Tkwug="; }; build-system = [ poetry-core ]; + pythonRelaxDeps = [ + "pydicom" + ]; + dependencies = [ httpx pydicom @@ -33,11 +35,11 @@ buildPythonPackage rec { pythonImportsCheck = [ "pyorthanc" ]; - meta = with lib; { + meta = { description = "Python library that wraps the Orthanc REST API"; homepage = "https://github.com/gacou54/pyorthanc"; - changelog = "https://github.com/gacou54/pyorthanc/releases/tag/${src.tag}"; - license = licenses.mit; - maintainers = with maintainers; [ bcdarwin ]; + changelog = "https://github.com/gacou54/pyorthanc/releases/tag/v${version}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ bcdarwin ]; }; } From d82a1958bb7154754dd7cfb2c9a7043ef6052af1 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Mon, 17 Feb 2025 13:45:01 +0100 Subject: [PATCH 07/10] python312Packages.pydicom-seg: mark as broken --- .../python-modules/pydicom-seg/default.nix | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/pkgs/development/python-modules/pydicom-seg/default.nix b/pkgs/development/python-modules/pydicom-seg/default.nix index 420c4505e706..0797548a190f 100644 --- a/pkgs/development/python-modules/pydicom-seg/default.nix +++ b/pkgs/development/python-modules/pydicom-seg/default.nix @@ -3,13 +3,18 @@ buildPythonPackage, fetchFromGitHub, fetchpatch, - pythonOlder, - pytest7CheckHook, + + # build-system poetry-core, + + # dependencies jsonschema, numpy, pydicom, simpleitk, + + # tests + pytestCheckHook, }: buildPythonPackage rec { @@ -17,14 +22,12 @@ buildPythonPackage rec { version = "0.4.1"; pyproject = true; - disabled = pythonOlder "3.7"; - src = fetchFromGitHub { owner = "razorx89"; - repo = pname; + repo = "pydicom-seg"; tag = "v${version}"; - hash = "sha256-2Y3fZHKfZqdp5EU8HfVsmJ5JFfVGZuAR7+Kj7qaTiPM="; fetchSubmodules = true; + hash = "sha256-2Y3fZHKfZqdp5EU8HfVsmJ5JFfVGZuAR7+Kj7qaTiPM="; }; patches = [ @@ -36,7 +39,10 @@ buildPythonPackage rec { }) ]; - pythonRelaxDeps = [ "jsonschema" ]; + pythonRelaxDeps = [ + "jsonschema" + "numpy" + ]; build-system = [ poetry-core ]; @@ -47,15 +53,17 @@ buildPythonPackage rec { simpleitk ]; - nativeCheckInputs = [ pytest7CheckHook ]; + nativeCheckInputs = [ pytestCheckHook ]; pythonImportsCheck = [ "pydicom_seg" ]; - meta = with lib; { + meta = { description = "Medical segmentation file reading and writing"; homepage = "https://github.com/razorx89/pydicom-seg"; changelog = "https://github.com/razorx89/pydicom-seg/releases/tag/v${version}"; - license = licenses.mit; - maintainers = with maintainers; [ bcdarwin ]; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ bcdarwin ]; + # ModuleNotFoundError: No module named 'pydicom._storage_sopclass_uids' + broken = true; }; } From efbeabd3cc08989430b5235151f9a961f1cd9693 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Mon, 17 Feb 2025 14:01:21 +0100 Subject: [PATCH 08/10] python312Packages.deid: 0.3.25 -> 0.4.0 Diff: https://github.com/pydicom/deid/compare/830966d52846c6b721fabb4cc1c75f39eabd55cc...14d1e4eb70f2c9fda43fca411794be9d8a5a8516 Changelog: https://github.com/pydicom/deid/blob/0.4.0/CHANGELOG.md --- .../python-modules/deid/default.nix | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/pkgs/development/python-modules/deid/default.nix b/pkgs/development/python-modules/deid/default.nix index 8d60dd9aa3e9..4158e30b6948 100644 --- a/pkgs/development/python-modules/deid/default.nix +++ b/pkgs/development/python-modules/deid/default.nix @@ -2,22 +2,20 @@ lib, buildPythonPackage, fetchFromGitHub, - pythonOlder, - pytestCheckHook, + setuptools, matplotlib, pydicom, python-dateutil, - setuptools, + pytestCheckHook, + versionCheckHook, }: let - deid-data = buildPythonPackage rec { + deid-data = buildPythonPackage { pname = "deid-data"; version = "unstable-2022-12-06"; pyproject = true; - disabled = pythonOlder "3.7"; - build-system = [ setuptools ]; dependencies = [ pydicom ]; @@ -39,18 +37,16 @@ let in buildPythonPackage rec { pname = "deid"; - version = "0.3.25"; + version = "0.4.0"; pyproject = true; - disabled = pythonOlder "3.7"; - # Pypi version has no tests src = fetchFromGitHub { owner = "pydicom"; - repo = pname; + repo = "deid"; # the github repo does not contain Pypi version tags: - rev = "830966d52846c6b721fabb4cc1c75f39eabd55cc"; - hash = "sha256-+slwnQSeRHpoCsvZ24Gq7rOBpQL37a6Iqrj4Mqj6PCo="; + rev = "14d1e4eb70f2c9fda43fca411794be9d8a5a8516"; + hash = "sha256-YsLWHIO6whcBQriMYb0tDD9s/RrxlfeKGORF1UCOilI="; }; build-system = [ setuptools ]; @@ -64,7 +60,9 @@ buildPythonPackage rec { nativeCheckInputs = [ deid-data pytestCheckHook + versionCheckHook ]; + versionCheckProgramArg = [ "--version" ]; pythonImportsCheck = [ "deid" ]; From 8d16040dacc36bd872bd0c4f95a5559d730b5265 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Mon, 17 Feb 2025 14:15:09 +0100 Subject: [PATCH 09/10] python312Packages.dicom2nifti: cleanup & fix --- .../python-modules/dicom2nifti/default.nix | 64 +++++++++++++------ 1 file changed, 43 insertions(+), 21 deletions(-) diff --git a/pkgs/development/python-modules/dicom2nifti/default.nix b/pkgs/development/python-modules/dicom2nifti/default.nix index 6df9a652fb6f..bb426fd4d483 100644 --- a/pkgs/development/python-modules/dicom2nifti/default.nix +++ b/pkgs/development/python-modules/dicom2nifti/default.nix @@ -2,16 +2,22 @@ lib, buildPythonPackage, fetchFromGitHub, - pythonOlder, - pytestCheckHook, + + # build-system + setuptools, + + # dependencies gdcm, nibabel, numpy, pydicom, + scipy, + + # tests + pillow, pylibjpeg, pylibjpeg-libjpeg, - scipy, - setuptools, + pytestCheckHook, }: buildPythonPackage rec { @@ -19,8 +25,6 @@ buildPythonPackage rec { version = "2.5.1"; pyproject = true; - disabled = pythonOlder "3.6"; - # no tests in PyPI dist src = fetchFromGitHub { owner = "icometrix"; @@ -29,9 +33,14 @@ buildPythonPackage rec { hash = "sha256-lPaBKqYO8B138fCgeKH6vpwGQhN3JCOnDj5PgaYfRPA="; }; + postPatch = '' + substituteInPlace tests/test_generic.py --replace-fail "from common" "from dicom2nifti.common" + substituteInPlace tests/test_ge.py --replace-fail "import convert_generic" "import dicom2nifti.convert_generic as convert_generic" + ''; + build-system = [ setuptools ]; - propagatedBuildInputs = [ + dependencies = [ gdcm nibabel numpy @@ -39,24 +48,37 @@ buildPythonPackage rec { scipy ]; - postPatch = '' - substituteInPlace tests/test_generic.py --replace-fail "from common" "from dicom2nifti.common" - substituteInPlace tests/test_ge.py --replace-fail "import convert_generic" "import dicom2nifti.convert_generic as convert_generic" - ''; - - nativeCheckInputs = [ - pytestCheckHook - pylibjpeg - pylibjpeg-libjpeg - ]; - pythonImportsCheck = [ "dicom2nifti" ]; - meta = with lib; { + nativeCheckInputs = [ + pillow + pylibjpeg + pylibjpeg-libjpeg + pytestCheckHook + ]; + + disabledTests = [ + # OverflowError: Python integer -1024 out of bounds for uint16 + "test_not_a_volume" + "test_resampling" + "test_validate_orthogonal_disabled" + + # RuntimeError: Unable to decompress 'JPEG 2000 Image Compression (Lossless O... + "test_anatomical" + "test_compressed_j2k" + "test_main_function" + "test_rgb" + + # Missing script 'dicom2nifti_scrip' + "test_gantry_option" + "test_gantry_resampling" + ]; + + meta = { homepage = "https://github.com/icometrix/dicom2nifti"; description = "Library for converting dicom files to nifti"; mainProgram = "dicom2nifti"; - license = licenses.mit; - maintainers = with maintainers; [ bcdarwin ]; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ bcdarwin ]; }; } From 3e78b6ac4c19501f809b303e6176eba63f774785 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Mon, 17 Feb 2025 14:23:19 +0100 Subject: [PATCH 10/10] python312Packages.torchio: 0.20.3 -> 0.20.4 Diff: https://github.com/fepegar/torchio/compare/refs/tags/v0.20.3...v0.20.4 --- .../python-modules/torchio/default.nix | 43 +++++++++++++------ 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/pkgs/development/python-modules/torchio/default.nix b/pkgs/development/python-modules/torchio/default.nix index 9a2c22ffc736..3627c923ad6f 100644 --- a/pkgs/development/python-modules/torchio/default.nix +++ b/pkgs/development/python-modules/torchio/default.nix @@ -1,42 +1,54 @@ { - stdenv, lib, + stdenv, buildPythonPackage, fetchFromGitHub, - pytestCheckHook, - pythonOlder, + + # build-system + hatchling, + + # dependencies deprecated, - humanize, matplotlib, nibabel, numpy, - parameterized, + packaging, + rich, scipy, simpleitk, torch, tqdm, typer, + + # tests + humanize, + parameterized, + pytestCheckHook, }: buildPythonPackage rec { pname = "torchio"; - version = "0.20.3"; + version = "0.20.4"; pyproject = true; - disabled = pythonOlder "3.8"; - src = fetchFromGitHub { owner = "fepegar"; repo = "torchio"; tag = "v${version}"; - hash = "sha256-I91KcrCwHkjY7oh5RFWfV93pRgd4iQVCBVTtd4TqXGo="; + hash = "sha256-pcUc0pnpb3qQLMOYU9yh7cljyCQ+Ngf8fJDcrRrK8LQ="; }; - propagatedBuildInputs = [ + build-system = [ + hatchling + ]; + + dependencies = [ deprecated humanize nibabel numpy + packaging + rich scipy simpleitk torch @@ -45,10 +57,11 @@ buildPythonPackage rec { ]; nativeCheckInputs = [ - pytestCheckHook matplotlib parameterized + pytestCheckHook ]; + disabledTests = [ # tries to download models: @@ -58,15 +71,17 @@ buildPythonPackage rec { # RuntimeError: DataLoader worker (pid(s) <...>) exited unexpectedly "test_queue_multiprocessing" ]; + pythonImportsCheck = [ "torchio" "torchio.data" ]; - meta = with lib; { + meta = { description = "Medical imaging toolkit for deep learning"; homepage = "https://torchio.readthedocs.io"; - license = licenses.asl20; - maintainers = [ maintainers.bcdarwin ]; + changelog = "https://github.com/TorchIO-project/torchio/blob/v${version}/CHANGELOG.md"; + license = lib.licenses.asl20; + maintainers = [ lib.maintainers.bcdarwin ]; }; }