about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/nipy/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/nipy/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/nipy/default.nix82
1 files changed, 52 insertions, 30 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/nipy/default.nix b/nixpkgs/pkgs/development/python-modules/nipy/default.nix
index 63e6989d4dac..1a1813ebb8af 100644
--- a/nixpkgs/pkgs/development/python-modules/nipy/default.nix
+++ b/nixpkgs/pkgs/development/python-modules/nipy/default.nix
@@ -1,55 +1,77 @@
 { lib
 , buildPythonPackage
 , fetchPypi
-, pythonOlder
-, cython
-, nose
-, matplotlib
-, nibabel
+
+# build-system
+, cython_3
+, meson-python
+, ninja
+, setuptools
+
+# dependencies
 , numpy
 , scipy
+, nibabel
 , sympy
-, python
+, transforms3d
+
+# optional-dependencies
+, matplotlib
+
+# tests
+, pytestCheckHook
 }:
 
 buildPythonPackage rec {
-  version = "0.5.0";
-  format = "setuptools";
+  version = "0.6.0";
   pname = "nipy";
-  disabled = pythonOlder "2.6";
+  pyproject = true;
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "a8a2c97ce854fece4aced5a6394b9fdca5846150ad6d2a36b86590924af3c848";
+    hash = "sha256-BTn2nV4VMeT8bxTOJTHjRU8I2bxFZCzIZCZVn/QcUrk=";
   };
 
-  nativeBuildInputs = [ cython ];
-  buildInputs = lib.optionals doCheck [ nose ];
-  propagatedBuildInputs = [ matplotlib nibabel numpy scipy sympy ];
-
-  preBuild = ''
-    make recythonize
+  postPatch = ''
+    patchShebangs nipy/_build_utils/cythoner.py
   '';
 
-  checkPhase = ''    # wants to be run in a different directory
-    mkdir nosetests
-    cd nosetests
-    ${python.interpreter} -c "import nipy; nipy.test()"
-    rm -rf .
-  '';
+  build-system = [
+    cython_3
+    meson-python
+    setuptools
+    ninja
+    numpy
+  ];
+
+  dependencies = [
+    nibabel
+    numpy
+    scipy
+    sympy
+    transforms3d
+  ];
+
+  optional-dependencies.optional = [
+    matplotlib
+  ];
+
+  nativeCheckInputs = [
+    pytestCheckHook
+  ] ++ optional-dependencies.optional;
+
+  doCheck = false; # partial imports … circular dependencies. needs more time to figure out.
 
-  # failing test:
-  # nipy.algorithms.statistics.models.tests.test_olsR.test_results(11.593139639404727, 11.593140144880794, 6)  # disagrees by 1 at 6th decimal place
-  # erroring tests:
-  # nipy.modalities.fmri.fmristat.tests.test_FIAC.test_altprotocol
-  # nipy.modalities.fmri.fmristat.tests.test_FIAC.test_agreement
-  # nipy.tests.test_scripts.test_nipy_4d_realign   # because `nipy_4d_realign` script isn't found at test time; works from nix-shell, so could be patched
-  # nipy.tests.test_scripts.test_nipy_3_4d         # ditto re.: `nipy_3_4d` script
-  doCheck = false;
+  pythonImportsCheck = [
+    "nipy"
+    "nipy.testing"
+    "nipy.algorithms"
+  ];
 
   meta = with lib; {
     homepage = "https://nipy.org/nipy";
     description = "Software for structural and functional neuroimaging analysis";
+    downloadPage = "https://github.com/nipy/nipy";
     license = licenses.bsd3;
   };