2018-11-15 23:11:41 +00:00
|
|
|
{ pkgs
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, astropy
|
|
|
|
, requests
|
|
|
|
, keyring
|
|
|
|
, beautifulsoup4
|
|
|
|
, html5lib
|
2019-07-23 17:44:54 +01:00
|
|
|
, pytest
|
|
|
|
, pytest-astropy
|
|
|
|
, astropy-helpers
|
2018-11-15 23:11:41 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "astroquery";
|
2019-01-02 23:13:35 +00:00
|
|
|
version = "0.3.9";
|
2018-11-15 23:11:41 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2019-01-02 23:13:35 +00:00
|
|
|
sha256 = "0zw3xp2rfc6h2v569iqsyvzhfnzp7bfjb7jrj61is1hrqw1cqjrb";
|
2018-11-15 23:11:41 +00:00
|
|
|
};
|
|
|
|
|
2019-07-23 17:44:54 +01:00
|
|
|
# Fix tests using conftest.py from HEAD in the upstream GitHub
|
|
|
|
# repository.
|
|
|
|
patches = [ ./conftest-astropy-3-fix.patch ];
|
|
|
|
|
2018-11-15 23:11:41 +00:00
|
|
|
propagatedBuildInputs = [ astropy requests keyring beautifulsoup4 html5lib ];
|
|
|
|
|
2019-07-23 17:44:54 +01:00
|
|
|
nativeBuildInputs = [ astropy-helpers ];
|
|
|
|
|
|
|
|
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 in the build directory. The tests create files
|
|
|
|
# in $HOME/.astropy so we need to set HOME to $TMPDIR.
|
|
|
|
checkPhase = ''
|
|
|
|
cd build/lib
|
|
|
|
HOME=$TMPDIR pytest
|
|
|
|
'';
|
|
|
|
|
2018-11-15 23:11:41 +00:00
|
|
|
meta = with pkgs.lib; {
|
|
|
|
description = "Functions and classes to access online data resources";
|
|
|
|
homepage = "https://astroquery.readthedocs.io/";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = [ maintainers.smaret ];
|
|
|
|
};
|
|
|
|
}
|