2017-06-07 16:02:42 +01:00
|
|
|
{ lib
|
|
|
|
, fetchPypi
|
|
|
|
, buildPythonPackage
|
2018-03-20 13:30:01 +00:00
|
|
|
, isPy3k
|
2017-06-07 16:02:42 +01:00
|
|
|
, numpy
|
2019-07-23 10:50:25 +01:00
|
|
|
, pytest
|
|
|
|
, pytest-astropy
|
|
|
|
, astropy-helpers
|
|
|
|
}:
|
2017-06-07 16:02:42 +01:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "astropy";
|
2020-05-08 22:04:37 +01:00
|
|
|
version = "4.0.1.post1";
|
2017-06-07 16:02:42 +01:00
|
|
|
|
2018-03-20 13:30:01 +00:00
|
|
|
disabled = !isPy3k; # according to setup.py
|
|
|
|
|
2017-06-07 16:02:42 +01:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2020-05-08 22:04:37 +01:00
|
|
|
sha256 = "1da4xj793ldck29aajyb514wpz330cml26f3gdp45jj531n4lc2w";
|
2017-06-07 16:02:42 +01:00
|
|
|
};
|
2017-09-06 16:15:30 +01:00
|
|
|
|
2019-07-23 10:50:25 +01:00
|
|
|
nativeBuildInputs = [ astropy-helpers ];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ numpy pytest ]; # yes it really has pytest in install_requires
|
|
|
|
|
|
|
|
checkInputs = [ pytest pytest-astropy ];
|
|
|
|
|
|
|
|
# Disable automatic update of the astropy-helper module
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.cfg --replace "auto_use = True" "auto_use = False"
|
|
|
|
'';
|
|
|
|
|
|
|
|
# Tests must be run from the build directory. astropy/samp tests
|
|
|
|
# require a network connection, so we ignore them. For some reason
|
|
|
|
# pytest --ignore does not work, so we delete the tests instead.
|
|
|
|
checkPhase = ''
|
|
|
|
cd build/lib.*
|
|
|
|
rm -f astropy/samp/tests/*
|
|
|
|
pytest
|
|
|
|
'';
|
2017-06-07 16:02:42 +01:00
|
|
|
|
2019-09-13 17:45:58 +01:00
|
|
|
# 368 failed, 10889 passed, 978 skipped, 69 xfailed in 196.24s
|
|
|
|
doCheck = false;
|
|
|
|
|
2017-06-07 16:02:42 +01:00
|
|
|
meta = {
|
|
|
|
description = "Astronomy/Astrophysics library for Python";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://www.astropy.org";
|
2017-06-07 16:02:42 +01:00
|
|
|
license = lib.licenses.bsd3;
|
|
|
|
platforms = lib.platforms.all;
|
|
|
|
maintainers = with lib.maintainers; [ kentjames ];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|