1{ lib
2, fetchPypi
3, setuptools-scm
4, buildPythonPackage
5, isPy3k
6, cython
7, jinja2
8, numpy
9, pytest
10, pytest-astropy
11, astropy-helpers
12, astropy-extension-helpers
13, pyerfa
14}:
15
16buildPythonPackage rec {
17 pname = "astropy";
18 version = "4.3.1";
19 format = "pyproject";
20
21 disabled = !isPy3k; # according to setup.py
22
23 src = fetchPypi {
24 inherit pname version;
25 sha256 = "sha256-LTlRIjtOt/No/K2Mg0DSc3TF2OO2NaY2J1rNs481zVE=";
26 };
27
28 nativeBuildInputs = [ setuptools-scm astropy-helpers astropy-extension-helpers cython jinja2 ];
29 propagatedBuildInputs = [ numpy pyerfa ];
30 checkInputs = [ pytest pytest-astropy ];
31
32 preBuild = ''
33 export SETUPTOOLS_SCM_PRETEND_VERSION="${version}"
34 '';
35
36 # Tests must be run from the build directory. astropy/samp tests
37 # require a network connection, so we ignore them. For some reason
38 # pytest --ignore does not work, so we delete the tests instead.
39 checkPhase = ''
40 cd build/lib.*
41 rm -f astropy/samp/tests/*
42 pytest
43 '';
44
45 # 368 failed, 10889 passed, 978 skipped, 69 xfailed in 196.24s
46 # doCheck = false;
47 doCheck = false;
48
49 meta = with lib; {
50 description = "Astronomy/Astrophysics library for Python";
51 homepage = "https://www.astropy.org";
52 license = licenses.bsd3;
53 platforms = platforms.all;
54 maintainers = [ maintainers.kentjames ];
55 };
56}