1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchPypi,
6 pythonOlder,
7 # python dependencies
8 click,
9 python-dateutil,
10 etelemetry,
11 filelock,
12 looseversion,
13 mock,
14 networkx,
15 nibabel,
16 numpy,
17 packaging,
18 prov,
19 psutil,
20 puremagic,
21 pybids,
22 pydot,
23 pytest,
24 pytest-xdist,
25 pytest-forked,
26 rdflib,
27 scipy,
28 simplejson,
29 traits,
30 xvfbwrapper,
31 # other dependencies
32 which,
33 bash,
34 glibcLocales,
35 # causes Python packaging conflict with any package requiring rdflib,
36 # so use the unpatched rdflib by default (disables Nipype provenance tracking);
37 # see https://github.com/nipy/nipype/issues/2888:
38 useNeurdflib ? false,
39}:
40
41buildPythonPackage rec {
42 pname = "nipype";
43 version = "1.10.0";
44 format = "setuptools";
45
46 src = fetchPypi {
47 inherit pname version;
48 hash = "sha256-GeXWzvpwmXGY94vGZe9NPTy1MyW1uYpy5Rrvra9rPg4=";
49 };
50
51 postPatch = ''
52 substituteInPlace nipype/interfaces/base/tests/test_core.py \
53 --replace-fail "/usr/bin/env bash" "${bash}/bin/bash"
54 '';
55
56 pythonRelaxDeps = [ "traits" ];
57
58 dependencies = [
59 click
60 python-dateutil
61 etelemetry
62 filelock
63 looseversion
64 networkx
65 nibabel
66 numpy
67 packaging
68 prov
69 psutil
70 puremagic
71 pydot
72 rdflib
73 scipy
74 simplejson
75 traits
76 xvfbwrapper
77 ];
78
79 nativeCheckInputs = [
80 pybids
81 glibcLocales
82 mock
83 pytest
84 pytest-forked
85 pytest-xdist
86 which
87 ];
88
89 # checks on darwin inspect memory which doesn't work in build environment
90 doCheck = !stdenv.hostPlatform.isDarwin;
91 # ignore tests which incorrect fail to detect xvfb
92 checkPhase = ''
93 pytest nipype/tests -k 'not display and not test_no_et_multiproc'
94 '';
95 pythonImportsCheck = [ "nipype" ];
96
97 meta = {
98 homepage = "https://nipy.org/nipype";
99 description = "Neuroimaging in Python: Pipelines and Interfaces";
100 changelog = "https://github.com/nipy/nipype/releases/tag/${version}";
101 mainProgram = "nipypecli";
102 license = lib.licenses.bsd3;
103 maintainers = with lib.maintainers; [ ashgillman ];
104 };
105}