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