depot/third_party/nixpkgs/pkgs/development/python-modules/spectral-cube/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

74 lines
1.4 KiB
Nix

{
lib,
stdenv,
buildPythonPackage,
pythonOlder,
fetchPypi,
# build-system
setuptools-scm,
# dependencies
astropy,
casa-formats-io,
dask,
joblib,
looseversion,
radio-beam,
# checks
aplpy,
pytest-astropy,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "spectral-cube";
version = "0.6.5";
pyproject = true;
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit pname version;
hash = "sha256-gJzrr3+/FsQN/HHDERxf/NECArwOaTqFwmI/Q2Z9HTM=";
};
patches = [ ./distutils-looseversion.patch ];
build-system = [ setuptools-scm ];
dependencies = [
astropy
casa-formats-io
dask
joblib
looseversion
radio-beam
];
nativeCheckInputs = [
aplpy
pytest-astropy
pytestCheckHook
];
# Tests must be run in the build directory.
preCheck = ''
cd build/lib
'';
# On x86_darwin, this test fails with "Fatal Python error: Aborted"
# when sandbox = true.
disabledTestPaths = lib.optionals stdenv.isDarwin [ "spectral_cube/tests/test_visualization.py" ];
pythonImportsCheck = [ "spectral_cube" ];
meta = {
description = "Library for reading and analyzing astrophysical spectral data cubes";
homepage = "https://spectral-cube.readthedocs.io";
changelog = "https://github.com/radio-astro-tools/spectral-cube/releases/tag/v${version}";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ smaret ];
};
}