@@ -1,14 +1,17 @@
11{ lib
22, fetchPypi
33, buildPythonPackage
4−, astropy }:
4+, astropy
5+, pytest
6+, pytest-astropy
7+, astropy-helpers
8+, scipy
9+}:
510
611buildPythonPackage rec {
712 pname = "radio_beam";
813 version = "0.3.1";
914
10− doCheck = false; # the tests requires several pytest plugins that are not in nixpkgs
11−
1215 src = fetchPypi {
1316 inherit pname version;
1417 sha256 = "1wgd9dyz3pcc9ighkclb6qfyshwbg35s57lz6k62jhcxpvp8r5zb";
@@ -16,6 +19,21 @@ buildPythonPackage rec {
1619
1720 propagatedBuildInputs = [ astropy ];
1821
22+ nativeBuildInputs = [ astropy-helpers ];
23+
24+ # Disable automatic update of the astropy-helper module
25+ postPatch = ''
26+ substituteInPlace setup.cfg --replace "auto_use = True" "auto_use = False"
27+ '';
28+
29+ checkInputs = [ pytest pytest-astropy scipy ];
30+
31+ # Tests must be run in the build directory
32+ checkPhase = ''
33+ cd build/lib
34+ pytest
35+ '';
36+
1937 meta = {
2038 description = "Tools for Beam IO and Manipulation";
2139 homepage = http://radio-astro-tools.github.io;