1{
2 stdenv,
3 lib,
4 buildPythonPackage,
5 fetchPypi,
6 pythonOlder,
7 pytestCheckHook,
8 cython,
9 setuptools,
10 setuptools-scm,
11 wheel,
12 numpy,
13 scipy,
14 matplotlib,
15 networkx,
16 nibabel,
17}:
18
19buildPythonPackage rec {
20 pname = "nitime";
21 version = "0.10.2";
22 disabled = pythonOlder "3.7";
23 format = "pyproject";
24
25 src = fetchPypi {
26 inherit pname version;
27 hash = "sha256-NCaWr7ZqL1XV0QfUD+4+Yn33N1cCP33ib5oJ91OtJLU=";
28 };
29
30 # Upstream wants to build against the oldest version of numpy possible, but
31 # we only want to build against the most recent version.
32 postPatch = ''
33 substituteInPlace pyproject.toml \
34 --replace "numpy==" "numpy>="
35 '';
36
37 nativeBuildInputs = [
38 cython
39 setuptools
40 setuptools-scm
41 wheel
42 ];
43
44 propagatedBuildInputs = [
45 numpy
46 scipy
47 matplotlib
48 networkx
49 nibabel
50 ];
51
52 nativeCheckInputs = [ pytestCheckHook ];
53
54 doCheck = !stdenv.isDarwin; # tests hang indefinitely
55
56 pythonImportsCheck = [ "nitime" ];
57
58 meta = with lib; {
59 homepage = "https://nipy.org/nitime";
60 description = "Algorithms and containers for time-series analysis in time and spectral domains";
61 license = licenses.bsd3;
62 maintainers = [ maintainers.bcdarwin ];
63 };
64}