<commit_before>{ lib
, buildPythonPackage
, fetchFromGitHub
, isPy27
, gdcm
, nose
, nibabel
, numpy
, pydicom
, scipy
, setuptools
}:

buildPythonPackage rec {
  pname = "dicom2nifti";
  version = "2.3.0";
  disabled = isPy27;

  # no tests in PyPI dist
  src = fetchFromGitHub {
    owner = "icometrix";
    repo = pname;
    rev = version;
    sha256 = "sha256-QSu9CGXFjDpI25Cy6QSbrwiQ2bwsVezCUxSovRLs6AI=";
  };

  propagatedBuildInputs = [ nibabel numpy pydicom scipy setuptools ];

  checkInputs = [ nose gdcm ];
  checkPhase = "nosetests tests";

  meta = with lib; {
    homepage = "https://github.com/icometrix/dicom2nifti";
    description = "Library for converting dicom files to nifti";
    license = licenses.mit;
    maintainers = with maintainers; [ bcdarwin ];
  };
}<commit_msg>python3Packages.dicom2nifti: 2.3.0 -> 2.4.3<commit_after>{ lib
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
, pytestCheckHook
, gdcm
, nibabel
, numpy
, pydicom
, scipy
, setuptools
}:

buildPythonPackage rec {
  pname = "dicom2nifti";
  version = "2.4.3";
  disabled = pythonOlder "3.6";

  # no tests in PyPI dist
  src = fetchFromGitHub {
    owner = "icometrix";
    repo = pname;
    rev = version;
    hash = "sha256-za2+HdnUhPu3+p29JsF4iL1lyPQVmEv3fam0Yf1oeMQ=";
  };

  propagatedBuildInputs = [ gdcm nibabel numpy pydicom scipy setuptools ];

  # 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";
    description = "Library for converting dicom files to nifti";
    license = licenses.mit;
    maintainers = with maintainers; [ bcdarwin ];
  };
}
{'fraction_non_alphanumeric': 0.11454809086515225, 'fraction_numerical': 0.026582890285161913, 'mean_word_length': 3.6621621621621623, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '932687', 'n_tokens_mistral': 820, 'n_tokens_neox': 778, 'n_words': 174}