1{
2 lib,
3 stdenv,
4 aplpy,
5 astropy,
6 buildPythonPackage,
7 casa-formats-io,
8 dask,
9 fetchPypi,
10 joblib,
11 pytest-astropy,
12 pytestCheckHook,
13 pythonOlder,
14 radio-beam,
15 setuptools-scm,
16}:
17
18buildPythonPackage rec {
19 pname = "spectral-cube";
20 version = "0.6.5";
21 format = "pyproject";
22
23 disabled = pythonOlder "3.7";
24
25 src = fetchPypi {
26 inherit pname version;
27 hash = "sha256-gJzrr3+/FsQN/HHDERxf/NECArwOaTqFwmI/Q2Z9HTM=";
28 };
29
30 nativeBuildInputs = [ setuptools-scm ];
31
32 propagatedBuildInputs = [
33 astropy
34 casa-formats-io
35 radio-beam
36 joblib
37 dask
38 ];
39
40 nativeCheckInputs = [
41 aplpy
42 pytest-astropy
43 pytestCheckHook
44 ];
45
46 # Tests must be run in the build directory.
47 preCheck = ''
48 cd build/lib
49 '';
50
51 # On x86_darwin, this test fails with "Fatal Python error: Aborted"
52 # when sandbox = true.
53 disabledTestPaths = lib.optionals stdenv.isDarwin [ "spectral_cube/tests/test_visualization.py" ];
54
55 pythonImportsCheck = [ "spectral_cube" ];
56
57 meta = with lib; {
58 description = "Library for reading and analyzing astrophysical spectral data cubes";
59 homepage = "https://spectral-cube.readthedocs.io";
60 changelog = "https://github.com/radio-astro-tools/spectral-cube/releases/tag/v${version}";
61 license = licenses.bsd3;
62 maintainers = with maintainers; [ smaret ];
63 };
64}