2018-05-28 12:50:10 +02:00
|
|
|
{ lib
|
2019-12-02 11:07:26 +01:00
|
|
|
, fetchFromGitHub
|
2018-05-28 12:50:10 +02:00
|
|
|
, buildPythonPackage
|
|
|
|
, astropy
|
|
|
|
, radio_beam
|
2019-07-23 12:15:59 +02:00
|
|
|
, pytest
|
|
|
|
, pytest-astropy
|
|
|
|
, astropy-helpers
|
|
|
|
}:
|
2018-05-28 12:50:10 +02:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "spectral-cube";
|
2019-12-02 11:07:26 +01:00
|
|
|
version = "0.4.5";
|
|
|
|
|
|
|
|
# Fetch from GitHub instead of PyPi, as 0.4.5 isn't available in PyPi
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "radio-astro-tools";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "1xc1m6vpl0bm600fx9vypa7zcvwg7yvhgn0w89y6v9d1vl0qcs7z";
|
2018-05-28 12:50:10 +02:00
|
|
|
};
|
|
|
|
|
2019-07-23 12:15:59 +02:00
|
|
|
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
|
|
|
|
'';
|
2018-05-28 12:50:10 +02:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Library for reading and analyzing astrophysical spectral data cubes";
|
|
|
|
homepage = http://radio-astro-tools.github.io;
|
|
|
|
license = lib.licenses.bsd3;
|
|
|
|
platforms = lib.platforms.all;
|
|
|
|
maintainers = with lib.maintainers; [ smaret ];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|