nixpkgs/pkgs/development/python-modules/astropy/default.nix
2020-12-28 15:16:21 -05:00

57 lines
1.3 KiB
Nix

{ lib
, fetchPypi
, setuptools_scm
, buildPythonPackage
, isPy3k
, cython
, jinja2
, numpy
, pytest
, pytest-astropy
, astropy-helpers
, astropy-extension-helpers
, pyerfa
}:
buildPythonPackage rec {
pname = "astropy";
version = "4.2";
format = "pyproject";
disabled = !isPy3k; # according to setup.py
src = fetchPypi {
inherit pname version;
sha256 = "2c194f8a429b8399de64a413a06881ea49f0525cabaa2d78fc132b9e970adc6a";
};
nativeBuildInputs = [ setuptools_scm astropy-helpers astropy-extension-helpers cython jinja2 ];
propagatedBuildInputs = [ numpy pyerfa ];
checkInputs = [ pytest pytest-astropy ];
preBuild = ''
export SETUPTOOLS_SCM_PRETEND_VERSION="${version}"
'';
# 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
'';
# 368 failed, 10889 passed, 978 skipped, 69 xfailed in 196.24s
# doCheck = false;
doCheck = false;
meta = with lib; {
description = "Astronomy/Astrophysics library for Python";
homepage = "https://www.astropy.org";
license = licenses.bsd3;
platforms = platforms.all;
maintainers = [ maintainers.kentjames ];
};
}