1{
2 lib,
3 buildPythonPackage,
4 datalad,
5 dcm2niix,
6 dcmstack,
7 etelemetry,
8 fetchPypi,
9 filelock,
10 git,
11 nibabel,
12 nipype,
13 pydicom,
14 pytestCheckHook,
15 pythonOlder,
16 setuptools,
17 versioningit,
18}:
19
20buildPythonPackage rec {
21 pname = "heudiconv";
22 version = "1.1.3";
23 pyproject = true;
24
25 disabled = pythonOlder "3.8";
26
27 src = fetchPypi {
28 inherit pname version;
29 hash = "sha256-ktw/XrvA5G+DunjEB8LeQuQnjs6zQOKsZ+RGpzDZ5DQ=";
30 };
31
32 postPatch = ''
33 substituteInPlace pyproject.toml \
34 --replace-fail "versioningit ~=" "versioningit >="
35 '';
36
37 build-system = [
38 setuptools
39 versioningit
40 ];
41
42 dependencies = [
43 dcmstack
44 etelemetry
45 filelock
46 nibabel
47 nipype
48 pydicom
49 ];
50
51 nativeCheckInputs = [
52 datalad
53 dcm2niix
54 pytestCheckHook
55 git
56 ];
57
58 preCheck = ''
59 export HOME=$(mktemp -d)
60 '';
61
62 pythonImportsCheck = [ "heudiconv" ];
63
64 disabledTests = [
65 # No such file or directory
66 "test_bvals_are_zero"
67 ];
68
69 meta = with lib; {
70 description = "Flexible DICOM converter for organizing imaging data";
71 homepage = "https://heudiconv.readthedocs.io";
72 changelog = "https://github.com/nipy/heudiconv/releases/tag/v${version}";
73 license = licenses.asl20;
74 maintainers = with maintainers; [ bcdarwin ];
75 };
76}