depot/third_party/nixpkgs/pkgs/development/python-modules/spectral-cube/default.nix
Default email 2ce89355c3 Project import generated by Copybara.
GitOrigin-RevId: 22a81aa5fc15b2d41b12f7160a71cd4a9f3c3fa1
2020-06-15 17:56:04 +02:00

49 lines
1.1 KiB
Nix

{ lib
, fetchFromGitHub
, buildPythonPackage
, aplpy
, astropy
, radio_beam
, pytest
, pytest-astropy
, astropy-helpers
}:
buildPythonPackage rec {
pname = "spectral-cube";
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";
};
propagatedBuildInputs = [ astropy radio_beam ];
nativeBuildInputs = [ astropy-helpers ];
checkInputs = [ aplpy 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";
homepage = "http://radio-astro-tools.github.io";
license = lib.licenses.bsd3;
platforms = lib.platforms.all;
maintainers = with lib.maintainers; [ smaret ];
};
}