1{ lib
2, fetchPypi
3, buildPythonPackage
4, isPy3k
5, numpy
6, pytest
7, pytest-astropy
8, astropy-helpers
9}:
10
11buildPythonPackage rec {
12 pname = "astropy";
13 version = "4.0.1.post1";
14
15 disabled = !isPy3k; # according to setup.py
16
17 src = fetchPypi {
18 inherit pname version;
19 sha256 = "1da4xj793ldck29aajyb514wpz330cml26f3gdp45jj531n4lc2w";
20 };
21
22 nativeBuildInputs = [ astropy-helpers ];
23
24 propagatedBuildInputs = [ numpy pytest ]; # yes it really has pytest in install_requires
25
26 checkInputs = [ pytest pytest-astropy ];
27
28 # Disable automatic update of the astropy-helper module
29 postPatch = ''
30 substituteInPlace setup.cfg --replace "auto_use = True" "auto_use = False"
31 '';
32
33 # Tests must be run from the build directory. astropy/samp tests
34 # require a network connection, so we ignore them. For some reason
35 # pytest --ignore does not work, so we delete the tests instead.
36 checkPhase = ''
37 cd build/lib.*
38 rm -f astropy/samp/tests/*
39 pytest
40 '';
41
42 # 368 failed, 10889 passed, 978 skipped, 69 xfailed in 196.24s
43 doCheck = false;
44
45 meta = {
46 description = "Astronomy/Astrophysics library for Python";
47 homepage = "https://www.astropy.org";
48 license = lib.licenses.bsd3;
49 platforms = lib.platforms.all;
50 maintainers = with lib.maintainers; [ kentjames ];
51 };
52}
53
54