From a1a755e3171418027cba6b2d2245d987c1d321e2 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 18 May 2024 20:05:52 +0200 Subject: [PATCH 1/6] python312Packages.pybids: disable failing tests --- pkgs/development/python-modules/pybids/default.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/pybids/default.nix b/pkgs/development/python-modules/pybids/default.nix index d702b4d509d3..841648247695 100644 --- a/pkgs/development/python-modules/pybids/default.nix +++ b/pkgs/development/python-modules/pybids/default.nix @@ -58,19 +58,23 @@ buildPythonPackage rec { ]; disabledTests = [ - # looks for missing data: + # Test looks for missing data "test_config_filename" - # regression associated with formulaic >= 0.6.0 + # Regression associated with formulaic >= 0.6.0 # (see https://github.com/bids-standard/pybids/issues/1000) "test_split" + # AssertionError, TypeError + "test_run_variable_collection_bad_length_to_df_all_dense_var" + "test_extension_initial_dot" + "test_to_df" ]; meta = with lib; { description = "Python tools for querying and manipulating BIDS datasets"; - mainProgram = "pybids"; homepage = "https://github.com/bids-standard/pybids"; changelog = "https://github.com/bids-standard/pybids/blob/${version}/CHANGELOG.rst"; license = licenses.mit; maintainers = with maintainers; [ jonringer ]; + mainProgram = "pybids"; }; } From fb19b3d723604032ae4ab7cc986e97641ad1035d Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 18 May 2024 20:06:43 +0200 Subject: [PATCH 2/6] python312Packages.pybids: format with nixfmt --- .../python-modules/pybids/default.nix | 41 +++++++++---------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/pkgs/development/python-modules/pybids/default.nix b/pkgs/development/python-modules/pybids/default.nix index 841648247695..33a00bac9284 100644 --- a/pkgs/development/python-modules/pybids/default.nix +++ b/pkgs/development/python-modules/pybids/default.nix @@ -1,19 +1,20 @@ -{ buildPythonPackage -, lib -, fetchPypi -, setuptools -, formulaic -, click -, num2words -, numpy -, scipy -, pandas -, nibabel -, bids-validator -, sqlalchemy -, pytestCheckHook -, versioneer -, pythonRelaxDepsHook +{ + lib, + buildPythonPackage, + fetchPypi, + setuptools, + formulaic, + click, + num2words, + numpy, + scipy, + pandas, + nibabel, + bids-validator, + sqlalchemy, + pytestCheckHook, + versioneer, + pythonRelaxDepsHook, }: buildPythonPackage rec { @@ -49,13 +50,9 @@ buildPythonPackage rec { sqlalchemy ]; - pythonImportsCheck = [ - "bids" - ]; + pythonImportsCheck = [ "bids" ]; - nativeCheckInputs = [ - pytestCheckHook - ]; + nativeCheckInputs = [ pytestCheckHook ]; disabledTests = [ # Test looks for missing data From 2990b3c1ac9677352aed7813f35135dc4f21610a Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 18 May 2024 20:13:39 +0200 Subject: [PATCH 3/6] python312Packages.dcmstack: refactor --- .../python-modules/dcmstack/default.nix | 31 ++++++++++++++----- .../python-modules/heudiconv/default.nix | 18 +++++------ 2 files changed, 32 insertions(+), 17 deletions(-) diff --git a/pkgs/development/python-modules/dcmstack/default.nix b/pkgs/development/python-modules/dcmstack/default.nix index 8e7b74fc8dd3..a1dd38e9be24 100644 --- a/pkgs/development/python-modules/dcmstack/default.nix +++ b/pkgs/development/python-modules/dcmstack/default.nix @@ -1,37 +1,54 @@ { lib , buildPythonPackage , fetchFromGitHub -, pythonOlder -, pytestCheckHook , nibabel , pydicom , pylibjpeg-libjpeg +, pytestCheckHook +, pythonOlder +, setuptools }: buildPythonPackage rec { pname = "dcmstack"; version = "0.9"; - format = "setuptools"; + pyproject = true; + disabled = pythonOlder "3.7"; src = fetchFromGitHub { owner = "moloney"; - repo = pname; + repo = "dcmstack"; rev = "refs/tags/v${version}"; hash = "sha256-GVzih9H2m2ZGSuZMRuaDG78b95PI3j0WQw5M3l4KNCs="; }; - propagatedBuildInputs = [ + build-system = [ + setuptools + ]; + + dependencies = [ nibabel pydicom pylibjpeg-libjpeg ]; - nativeCheckInputs = [ pytestCheckHook ]; + nativeCheckInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ + "dcmstack" + ]; + + disabledTestPaths = [ + # AttributeError: 'TestNitoolCli' object has no attribute 'out_dir' + "test/test_cli.py" + ]; meta = with lib; { - homepage = "https://github.com/moloney/dcmstack"; description = "DICOM to Nifti conversion preserving metadata"; + homepage = "https://github.com/moloney/dcmstack"; license = licenses.mit; maintainers = with maintainers; [ bcdarwin ]; }; diff --git a/pkgs/development/python-modules/heudiconv/default.nix b/pkgs/development/python-modules/heudiconv/default.nix index 9c78027e0a83..c80ff30b5217 100644 --- a/pkgs/development/python-modules/heudiconv/default.nix +++ b/pkgs/development/python-modules/heudiconv/default.nix @@ -14,13 +14,12 @@ , pythonOlder , setuptools , versioningit -, wheel }: buildPythonPackage rec { pname = "heudiconv"; version = "1.1.0"; - format = "pyproject"; + pyproject = true; disabled = pythonOlder "3.8"; @@ -31,22 +30,21 @@ buildPythonPackage rec { postPatch = '' substituteInPlace pyproject.toml \ - --replace "versioningit ~=" "versioningit >=" + --replace-fail "versioningit ~=" "versioningit >=" ''; - nativeBuildInputs = [ + build-system = [ setuptools versioningit - wheel ]; - propagatedBuildInputs = [ - nibabel - pydicom - nipype + dependencies = [ dcmstack etelemetry filelock + nibabel + nipype + pydicom ]; nativeCheckInputs = [ @@ -65,8 +63,8 @@ buildPythonPackage rec { ]; meta = with lib; { - homepage = "https://heudiconv.readthedocs.io"; description = "Flexible DICOM converter for organizing imaging data"; + homepage = "https://heudiconv.readthedocs.io"; changelog = "https://github.com/nipy/heudiconv/releases/tag/v${version}"; license = licenses.asl20; maintainers = with maintainers; [ bcdarwin ]; From aba3b8455534d3402df4d74dc6c08c426e8e30ec Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 18 May 2024 20:13:58 +0200 Subject: [PATCH 4/6] python312Packages.dcmstack: format with nixfmt --- .../python-modules/dcmstack/default.nix | 31 ++++++++----------- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/pkgs/development/python-modules/dcmstack/default.nix b/pkgs/development/python-modules/dcmstack/default.nix index a1dd38e9be24..fd84640e8d78 100644 --- a/pkgs/development/python-modules/dcmstack/default.nix +++ b/pkgs/development/python-modules/dcmstack/default.nix @@ -1,12 +1,13 @@ -{ lib -, buildPythonPackage -, fetchFromGitHub -, nibabel -, pydicom -, pylibjpeg-libjpeg -, pytestCheckHook -, pythonOlder -, setuptools +{ + lib, + buildPythonPackage, + fetchFromGitHub, + nibabel, + pydicom, + pylibjpeg-libjpeg, + pytestCheckHook, + pythonOlder, + setuptools, }: buildPythonPackage rec { @@ -23,9 +24,7 @@ buildPythonPackage rec { hash = "sha256-GVzih9H2m2ZGSuZMRuaDG78b95PI3j0WQw5M3l4KNCs="; }; - build-system = [ - setuptools - ]; + build-system = [ setuptools ]; dependencies = [ nibabel @@ -33,13 +32,9 @@ buildPythonPackage rec { pylibjpeg-libjpeg ]; - nativeCheckInputs = [ - pytestCheckHook - ]; + nativeCheckInputs = [ pytestCheckHook ]; - pythonImportsCheck = [ - "dcmstack" - ]; + pythonImportsCheck = [ "dcmstack" ]; disabledTestPaths = [ # AttributeError: 'TestNitoolCli' object has no attribute 'out_dir' From 85046d1188d994e83a0b99a0a832cf15eaf06be9 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 18 May 2024 20:15:54 +0200 Subject: [PATCH 5/6] python312Packages.heudiconv: refactor --- pkgs/development/python-modules/heudiconv/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/development/python-modules/heudiconv/default.nix b/pkgs/development/python-modules/heudiconv/default.nix index c80ff30b5217..f20f95f1041b 100644 --- a/pkgs/development/python-modules/heudiconv/default.nix +++ b/pkgs/development/python-modules/heudiconv/default.nix @@ -62,6 +62,11 @@ buildPythonPackage rec { "heudiconv" ]; + disabledTests = [ + # No such file or directory + "test_bvals_are_zero" + ]; + meta = with lib; { description = "Flexible DICOM converter for organizing imaging data"; homepage = "https://heudiconv.readthedocs.io"; From 3dbac594158c0a06c747a143dfa26090e2008fc1 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 18 May 2024 20:16:13 +0200 Subject: [PATCH 6/6] python312Packages.heudiconv: format with nixfmt --- .../python-modules/heudiconv/default.nix | 37 +++++++++---------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/pkgs/development/python-modules/heudiconv/default.nix b/pkgs/development/python-modules/heudiconv/default.nix index f20f95f1041b..58a2e777a9cc 100644 --- a/pkgs/development/python-modules/heudiconv/default.nix +++ b/pkgs/development/python-modules/heudiconv/default.nix @@ -1,19 +1,20 @@ -{ lib -, buildPythonPackage -, datalad -, dcm2niix -, dcmstack -, etelemetry -, fetchPypi -, filelock -, git -, nibabel -, nipype -, pydicom -, pytestCheckHook -, pythonOlder -, setuptools -, versioningit +{ + lib, + buildPythonPackage, + datalad, + dcm2niix, + dcmstack, + etelemetry, + fetchPypi, + filelock, + git, + nibabel, + nipype, + pydicom, + pytestCheckHook, + pythonOlder, + setuptools, + versioningit, }: buildPythonPackage rec { @@ -58,9 +59,7 @@ buildPythonPackage rec { export HOME=$(mktemp -d) ''; - pythonImportsCheck = [ - "heudiconv" - ]; + pythonImportsCheck = [ "heudiconv" ]; disabledTests = [ # No such file or directory