@@ -3,20 +3,36 @@
33, buildPythonPackage
44, astropy
55, radio_beam
6−, pytest }:
6+, pytest
7+, pytest-astropy
8+, astropy-helpers
9+}:
710
811buildPythonPackage rec {
912 pname = "spectral-cube";
1013 version = "0.4.4";
1114
12− doCheck = false; # the tests requires several pytest plugins that are not in nixpkgs
13−
1415 src = fetchPypi {
1516 inherit pname version;
1617 sha256 = "9051ede204b1e25b6358b5e0e573b624ec0e208c24eb03a7ed4925b745c93b5e";
1718 };
1819
19− propagatedBuildInputs = [ astropy radio_beam pytest ];
20+ propagatedBuildInputs = [ astropy radio_beam ];
21+
22+ nativeBuildInputs = [ astropy-helpers ];
23+
24+ checkInputs = [ pytest pytest-astropy ];
25+
26+ # Disable automatic update of the astropy-helper module
27+ postPatch = ''
28+ substituteInPlace setup.cfg --replace "auto_use = True" "auto_use = False"
29+ '';
30+
31+ # Tests must be run in the build directory
32+ checkPhase = ''
33+ cd build/lib
34+ pytest
35+ '';
2036
2137 meta = {
2238 description = "Library for reading and analyzing astrophysical spectral data cubes";