1{ lib
2, stdenv
3, asdf
4, astropy
5, astropy-extension-helpers
6, astropy-helpers
7, beautifulsoup4
8, buildPythonPackage
9, drms
10, fetchPypi
11, glymur
12, h5netcdf
13, hypothesis
14, lxml
15, matplotlib
16, numpy
17, pandas
18, parfive
19, pytest-astropy
20, pytestCheckHook
21, pytest-mock
22, python-dateutil
23, pythonOlder
24, scikit-image
25, scipy
26, setuptools-scm
27, sqlalchemy
28, tqdm
29, zeep
30}:
31
32buildPythonPackage rec {
33 pname = "sunpy";
34 version = "5.0.1";
35 format = "setuptools";
36
37 disabled = pythonOlder "3.8";
38
39 src = fetchPypi {
40 inherit pname version;
41 hash = "sha256-7tmyywyfQw1T9qr5UbPH/KR+AmmhSaHunkeUGRKDl+Q=";
42 };
43
44 nativeBuildInputs = [
45 astropy-extension-helpers
46 setuptools-scm
47 ];
48
49 propagatedBuildInputs = [
50 astropy
51 astropy-helpers
52 numpy
53 parfive
54 ];
55
56 passthru.optional-dependencies = {
57 asdf = [
58 asdf
59 # asdf-astropy
60 ];
61 database = [
62 sqlalchemy
63 ];
64 image = [
65 scikit-image
66 scipy
67 ];
68 net = [
69 beautifulsoup4
70 drms
71 python-dateutil
72 tqdm
73 zeep
74 ];
75 jpeg2000 = [
76 glymur
77 lxml
78 ];
79 timeseries = [
80 # cdflib
81 h5netcdf
82 # h5py
83 matplotlib
84 pandas
85 ];
86 };
87
88 nativeCheckInputs = [
89 hypothesis
90 pytest-astropy
91 pytest-mock
92 pytestCheckHook
93 ] ++ passthru.optional-dependencies.asdf
94 ++ passthru.optional-dependencies.database
95 ++ passthru.optional-dependencies.image
96 ++ passthru.optional-dependencies.net
97 ++ passthru.optional-dependencies.timeseries;
98
99 postPatch = ''
100 substituteInPlace setup.cfg \
101 --replace " --dist no" ""
102 '';
103
104 # darwin has write permission issues
105 doCheck = stdenv.isLinux;
106
107 preCheck = ''
108 export HOME=$(mktemp -d)
109 '';
110
111 disabledTests = [
112 "rst"
113 "test_sunpy_warnings_logging"
114 "test_main_nonexisting_module"
115 "test_main_stdlib_module"
116 "test_find_dependencies"
117 ];
118
119 disabledTestPaths = [
120 # Tests are very slow
121 "sunpy/net/tests/test_fido.py"
122 # asdf.extensions plugin issue
123 "sunpy/io/special/asdf/resources/schemas/"
124 "sunpy/io/special/asdf/resources/manifests/sunpy-1.0.0.yaml"
125 # Requires mpl-animators package
126 "sunpy/map/tests/test_compositemap.py"
127 "sunpy/map/tests/test_mapbase.py"
128 "sunpy/map/tests/test_mapsequence.py"
129 "sunpy/map/tests/test_plotting.py"
130 "sunpy/map/tests/test_reproject_to.py"
131 "sunpy/net/tests/test_helioviewer.py"
132 "sunpy/timeseries/tests/test_timeseriesbase.py"
133 "sunpy/visualization/animator/tests/test_basefuncanimator.py"
134 "sunpy/visualization/animator/tests/test_mapsequenceanimator.py"
135 "sunpy/visualization/animator/tests/test_wcs.py"
136 "sunpy/visualization/colormaps/tests/test_cm.py"
137 # Requires cdflib package
138 "sunpy/timeseries/tests/test_timeseries_factory.py"
139 # Requires jplephem
140 "sunpy/image/tests/test_transform.py"
141 "sunpy/io/special/asdf/tests/test_coordinate_frames.py"
142 "sunpy/io/special/asdf/tests/test_genericmap.py"
143 # distutils is deprecated
144 "sunpy/io/setup_package.py"
145 ];
146
147 pytestFlagsArray = [
148 "-W"
149 "ignore::DeprecationWarning"
150 ];
151
152 # Wants a configuration file
153 # pythonImportsCheck = [
154 # "sunpy"
155 # ];
156
157 meta = with lib; {
158 description = "Python for Solar Physics";
159 homepage = "https://sunpy.org";
160 license = licenses.bsd2;
161 maintainers = with maintainers; [ ];
162 broken = true;
163 };
164}