1{ stdenv
2, buildPythonPackage
3, fetchPypi
4, isPy3k
5, isPy38
6# python dependencies
7, click
8, configparser ? null
9, dateutil
10, etelemetry
11, filelock
12, funcsigs
13, future
14, futures
15, mock
16, networkx
17, nibabel
18, numpy
19, packaging
20, pathlib2
21, prov
22, psutil
23, pybids
24, pydot
25, pytest
26, pytest_xdist
27, pytest-forked
28, scipy
29, simplejson
30, traits
31, xvfbwrapper
32, pytestcov
33, codecov
34, sphinx
35# other dependencies
36, which
37, bash
38, glibcLocales
39, callPackage
40}:
41
42assert !isPy3k -> configparser != null;
43
44let
45
46 # This is a temporary convenience package for changes waiting to be merged into the primary rdflib repo.
47 neurdflib = callPackage ./neurdflib.nix { };
48
49in
50
51buildPythonPackage rec {
52 pname = "nipype";
53 version = "1.5.1";
54
55 src = fetchPypi {
56 inherit pname version;
57 sha256 = "3d6aa37186e1d2f90917dfdf1faf5aeff469912554990e5d182ffe8435f250d5";
58 };
59
60 postPatch = ''
61 substituteInPlace nipype/interfaces/base/tests/test_core.py \
62 --replace "/usr/bin/env bash" "${bash}/bin/bash"
63 '';
64
65 nativeBuildInputs = [
66 sphinx
67 ];
68
69 propagatedBuildInputs = [
70 click
71 dateutil
72 etelemetry
73 filelock
74 funcsigs
75 future
76 networkx
77 neurdflib
78 nibabel
79 numpy
80 packaging
81 prov
82 psutil
83 pydot
84 scipy
85 simplejson
86 traits
87 xvfbwrapper
88 ] ++ stdenv.lib.optionals (!isPy3k) [
89 configparser
90 futures
91 pathlib2 # darwin doesn't receive this transitively, but it is in install_requires
92 ];
93
94 checkInputs = [
95 pybids
96 codecov
97 glibcLocales
98 mock
99 pytest
100 pytest-forked
101 pytest_xdist
102 pytestcov
103 which
104 ];
105
106 # checks on darwin inspect memory which doesn't work in build environment
107 doCheck = !stdenv.isDarwin;
108 # ignore tests which incorrect fail to detect xvfb
109 checkPhase = ''
110 LC_ALL="en_US.UTF-8" pytest nipype/tests -k 'not display'
111 '';
112 pythonImportsCheck = [ "nipype" ];
113
114 meta = with stdenv.lib; {
115 homepage = "https://nipy.org/nipype/";
116 description = "Neuroimaging in Python: Pipelines and Interfaces";
117 license = licenses.bsd3;
118 maintainers = with maintainers; [ ashgillman ];
119 };
120}