about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/spectral-cube/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/spectral-cube/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/spectral-cube/default.nix24
1 files changed, 20 insertions, 4 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/spectral-cube/default.nix b/nixpkgs/pkgs/development/python-modules/spectral-cube/default.nix
index 661bc6363f4f..c28b249d192c 100644
--- a/nixpkgs/pkgs/development/python-modules/spectral-cube/default.nix
+++ b/nixpkgs/pkgs/development/python-modules/spectral-cube/default.nix
@@ -3,20 +3,36 @@
 , buildPythonPackage
 , astropy
 , radio_beam
-, pytest }:
+, pytest
+, pytest-astropy
+, astropy-helpers
+}:
 
 buildPythonPackage rec {
   pname = "spectral-cube";
   version = "0.4.4";
 
-  doCheck = false; # the tests requires several pytest plugins that are not in nixpkgs
-
   src = fetchPypi {
     inherit pname version;
     sha256 = "9051ede204b1e25b6358b5e0e573b624ec0e208c24eb03a7ed4925b745c93b5e";
   };
 
-  propagatedBuildInputs = [ astropy radio_beam pytest ];
+  propagatedBuildInputs = [ astropy radio_beam ];
+
+  nativeBuildInputs = [ astropy-helpers ];
+
+  checkInputs = [ pytest pytest-astropy ];
+
+  # Disable automatic update of the astropy-helper module
+  postPatch = ''
+    substituteInPlace setup.cfg --replace "auto_use = True" "auto_use = False"
+  '';
+
+  # Tests must be run in the build directory
+  checkPhase = ''
+    cd build/lib
+    pytest
+  '';
 
   meta = {
     description = "Library for reading and analyzing astrophysical spectral data cubes";