From 3c73b03f1db67918798bf96103f0277fdfbacf47 Mon Sep 17 00:00:00 2001 From: Ben Darwin Date: Sat, 27 Aug 2022 16:36:32 -0400 Subject: [PATCH] python3Packages.dicom2nifti: 2.3.0 -> 2.4.3 --- .../python-modules/dicom2nifti/default.nix | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/dicom2nifti/default.nix b/pkgs/development/python-modules/dicom2nifti/default.nix index dd43902949ab..0a9344313303 100644 --- a/pkgs/development/python-modules/dicom2nifti/default.nix +++ b/pkgs/development/python-modules/dicom2nifti/default.nix @@ -1,9 +1,9 @@ { lib , buildPythonPackage , fetchFromGitHub -, isPy27 +, pythonOlder +, pytestCheckHook , gdcm -, nose , nibabel , numpy , pydicom @@ -13,21 +13,30 @@ buildPythonPackage rec { pname = "dicom2nifti"; - version = "2.3.0"; - disabled = isPy27; + version = "2.4.3"; + disabled = pythonOlder "3.6"; # no tests in PyPI dist src = fetchFromGitHub { owner = "icometrix"; repo = pname; rev = version; - sha256 = "sha256-QSu9CGXFjDpI25Cy6QSbrwiQ2bwsVezCUxSovRLs6AI="; + hash = "sha256-za2+HdnUhPu3+p29JsF4iL1lyPQVmEv3fam0Yf1oeMQ="; }; - propagatedBuildInputs = [ nibabel numpy pydicom scipy setuptools ]; + propagatedBuildInputs = [ gdcm nibabel numpy pydicom scipy setuptools ]; - checkInputs = [ nose gdcm ]; - checkPhase = "nosetests tests"; + # python-gdcm just builds the python interface provided by the "gdcm" package, so + # we should be able to replace "python-gdcm" with "gdcm" but this doesn't work + # (similar to https://github.com/NixOS/nixpkgs/issues/84774) + postPatch = '' + substituteInPlace setup.py --replace "python-gdcm" "" + substituteInPlace tests/test_generic.py --replace "from common" "from dicom2nifti.common" + ''; + + checkInputs = [ pytestCheckHook ]; + + pythonImportsCheck = [ "dicom2nifti" ]; meta = with lib; { homepage = "https://github.com/icometrix/dicom2nifti";