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