1{ lib
2, buildPythonPackage
3, fetchPypi
4, numpy
5, astropy
6, astropy-helpers
7, matplotlib
8, reproject
9, pyavm
10, pyregion
11, pillow
12, scikitimage
13, shapely
14, pytest
15, pytest-astropy
16}:
17
18buildPythonPackage rec {
19 pname = "aplpy";
20 version = "2.0.3";
21
22 src = fetchPypi {
23 pname = "APLpy";
24 inherit version;
25 sha256 = "239f3d83635ca4251536aeb577df7c60df77fc4d658097b92094719739aec3f3";
26 };
27
28 propagatedBuildInputs = [
29 numpy
30 astropy
31 matplotlib
32 reproject
33 pyavm
34 pyregion
35 pillow
36 scikitimage
37 shapely
38 ];
39
40 nativeBuildInputs = [ astropy-helpers ];
41
42 checkInputs = [ pytest pytest-astropy ];
43
44 # Disable automatic update of the astropy-helper module
45 postPatch = ''
46 substituteInPlace setup.cfg --replace "auto_use = True" "auto_use = False"
47 '';
48
49 # Tests must be run in the build directory
50 checkPhase = ''
51 cd build/lib
52 pytest
53 '';
54
55 meta = with lib; {
56 description = "The Astronomical Plotting Library in Python";
57 homepage = "http://aplpy.github.io";
58 license = licenses.mit;
59 maintainers = [ maintainers.smaret ];
60 };
61}