1{
2 lib,
3 astropy,
4 buildPythonPackage,
5 fetchpatch,
6 fetchPypi,
7 matplotlib,
8 numpy,
9 pillow,
10 pyavm,
11 pyregion,
12 pytest-astropy,
13 pytestCheckHook,
14 pythonOlder,
15 reproject,
16 scikit-image,
17 setuptools,
18 setuptools-scm,
19 shapely,
20 wheel,
21}:
22
23buildPythonPackage rec {
24 pname = "aplpy";
25 version = "2.1.0";
26 format = "pyproject";
27
28 disabled = pythonOlder "3.6";
29
30 src = fetchPypi {
31 pname = "aplpy";
32 inherit version;
33 hash = "sha256-KCdmBwQWt7IfHsjq7pWlbSISEpfQZDyt+SQSTDaUCV4=";
34 };
35
36 # Fix build with Astropy 6 and Python 3.12.
37 patches = [
38 # https://github.com/aplpy/aplpy/pull/496
39 (fetchpatch {
40 url = "https://github.com/aplpy/aplpy/commit/d232a4984bc6a83ec86dfdc3ab3bc1b05de44c48.patch";
41 hash = "sha256-jGUTzIrVdGNPy0BV8w46jzz045fDXBisiwIn90bn7oY=";
42 })
43 # https://github.com/aplpy/aplpy/pull/497
44 (fetchpatch {
45 url = "https://github.com/aplpy/aplpy/commit/468be394970b39f1aaa6debef51eb674e2dd86d8.patch";
46 hash = "sha256-/ovLrFOKb3RQ8TZSviuOV6EYNgz0gtrhVWZLFJBrzFg=";
47 })
48 ];
49
50 nativeBuildInputs = [
51 setuptools
52 setuptools-scm
53 wheel
54 ];
55
56 propagatedBuildInputs = [
57 astropy
58 matplotlib
59 numpy
60 pillow
61 pyavm
62 pyregion
63 reproject
64 scikit-image
65 shapely
66 ];
67
68 nativeCheckInputs = [
69 pytest-astropy
70 pytestCheckHook
71 ];
72
73 preCheck = ''
74 OPENMP_EXPECTED=0
75 '';
76
77 pythonImportsCheck = [ "aplpy" ];
78
79 meta = with lib; {
80 description = "The Astronomical Plotting Library in Python";
81 homepage = "http://aplpy.github.io";
82 license = licenses.mit;
83 maintainers = with maintainers; [ smaret ];
84 };
85}