1{ pkgs
2, buildPythonPackage
3, fetchPypi
4, astropy
5, requests
6, keyring
7, beautifulsoup4
8, html5lib
9, pytest
10, pytest-astropy
11, astropy-helpers
12}:
13
14buildPythonPackage rec {
15 pname = "astroquery";
16 version = "0.3.9";
17
18 src = fetchPypi {
19 inherit pname version;
20 sha256 = "0zw3xp2rfc6h2v569iqsyvzhfnzp7bfjb7jrj61is1hrqw1cqjrb";
21 };
22
23 # Fix tests using conftest.py from HEAD in the upstream GitHub
24 # repository.
25 patches = [ ./conftest-astropy-3-fix.patch ];
26
27 propagatedBuildInputs = [ astropy requests keyring beautifulsoup4 html5lib ];
28
29 nativeBuildInputs = [ astropy-helpers ];
30
31 checkInputs = [ pytest pytest-astropy ];
32
33 # Disable automatic update of the astropy-helper module
34 postPatch = ''
35 substituteInPlace setup.cfg --replace "auto_use = True" "auto_use = False"
36 '';
37
38 # Tests must be run in the build directory. The tests create files
39 # in $HOME/.astropy so we need to set HOME to $TMPDIR.
40 checkPhase = ''
41 cd build/lib
42 HOME=$TMPDIR pytest
43 '';
44
45 meta = with pkgs.lib; {
46 description = "Functions and classes to access online data resources";
47 homepage = "https://astroquery.readthedocs.io/";
48 license = licenses.bsd3;
49 maintainers = [ maintainers.smaret ];
50 };
51}