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