1{ lib
2, fetchPypi
3, buildPythonPackage
4, pythonOlder
5
6# build time
7, astropy-extension-helpers
8, cython
9, jinja2
10, oldest-supported-numpy
11, setuptools-scm
12, wheel
13
14# runtime
15, numpy
16, packaging
17, pyerfa
18, pyyaml
19}:
20
21let
22 pname = "astropy";
23 version = "5.2.1";
24in
25buildPythonPackage {
26 inherit pname version;
27 format = "pyproject";
28
29 disabled = pythonOlder "3.8"; # according to setup.cfg
30
31 src = fetchPypi {
32 inherit pname version;
33 hash = "sha256-9q4noHf46oSQPvp2x5C5hWFzQaAISw0hw5H3o/MyrCM=";
34 };
35
36 postPatch = ''
37 substituteInPlace pyproject.toml \
38 --replace 'cython==' 'cython>='
39 '';
40
41 nativeBuildInputs = [
42 astropy-extension-helpers
43 cython
44 jinja2
45 oldest-supported-numpy
46 setuptools-scm
47 wheel
48 ];
49
50 propagatedBuildInputs = [
51 numpy
52 packaging
53 pyerfa
54 pyyaml
55 ];
56
57 # infinite recursion with pytest-astropy (pytest-astropy-header depends on astropy itself)
58 doCheck = false;
59
60 meta = with lib; {
61 description = "Astronomy/Astrophysics library for Python";
62 homepage = "https://www.astropy.org";
63 license = licenses.bsd3;
64 platforms = platforms.all;
65 maintainers = [ maintainers.kentjames ];
66 };
67}