summary refs log tree commit diff
path: root/pkgs/development/python-modules/radio_beam
diff options
context:
space:
mode:
authorSébastien Maret <sebastien.maret@icloud.com>2019-07-23 12:27:29 +0200
committerFrederik Rietdijk <freddyrietdijk@fridh.nl>2019-07-27 11:58:50 +0200
commit723382b0bfa366ffc90aca31348a28d74228a3b5 (patch)
tree7588b881f5db425fc435265846dcb9c3c8d42cb4 /pkgs/development/python-modules/radio_beam
parent5e7213b61598f8b86ab806c297cf1a5bd0ad89f9 (diff)
downloadnixpkgs-723382b0bfa366ffc90aca31348a28d74228a3b5.tar
nixpkgs-723382b0bfa366ffc90aca31348a28d74228a3b5.tar.gz
nixpkgs-723382b0bfa366ffc90aca31348a28d74228a3b5.tar.bz2
nixpkgs-723382b0bfa366ffc90aca31348a28d74228a3b5.tar.lz
nixpkgs-723382b0bfa366ffc90aca31348a28d74228a3b5.tar.xz
nixpkgs-723382b0bfa366ffc90aca31348a28d74228a3b5.tar.zst
nixpkgs-723382b0bfa366ffc90aca31348a28d74228a3b5.zip
pythonPackages.radio_beam: add checkPhase
Diffstat (limited to 'pkgs/development/python-modules/radio_beam')
-rw-r--r--pkgs/development/python-modules/radio_beam/default.nix24
1 files changed, 21 insertions, 3 deletions
diff --git a/pkgs/development/python-modules/radio_beam/default.nix b/pkgs/development/python-modules/radio_beam/default.nix
index 8b2fdc90f04..09d815134ef 100644
--- a/pkgs/development/python-modules/radio_beam/default.nix
+++ b/pkgs/development/python-modules/radio_beam/default.nix
@@ -1,14 +1,17 @@
 { lib
 , fetchPypi
 , buildPythonPackage
-, astropy }:
+, astropy
+, pytest
+, pytest-astropy
+, astropy-helpers
+, scipy
+}:
 
 buildPythonPackage rec {
   pname = "radio_beam";
   version = "0.3.1";
 
-  doCheck = false; # the tests requires several pytest plugins that are not in nixpkgs
-
   src = fetchPypi {
     inherit pname version;
     sha256 = "1wgd9dyz3pcc9ighkclb6qfyshwbg35s57lz6k62jhcxpvp8r5zb";
@@ -16,6 +19,21 @@ buildPythonPackage rec {
 
   propagatedBuildInputs = [ astropy ];
 
+  nativeBuildInputs = [ astropy-helpers ];
+
+  # Disable automatic update of the astropy-helper module
+  postPatch = ''
+    substituteInPlace setup.cfg --replace "auto_use = True" "auto_use = False"
+  '';
+
+  checkInputs = [ pytest pytest-astropy scipy ];
+
+  # Tests must be run in the build directory
+  checkPhase = ''
+    cd build/lib
+    pytest
+  '';
+
   meta = {
     description = "Tools for Beam IO and Manipulation";
     homepage = http://radio-astro-tools.github.io;