1{ pkgs
2, buildPythonPackage
3, fetchPypi
4, astropy
5, requests
6, keyring
7, beautifulsoup4
8, html5lib
9, matplotlib
10, pillow
11, pytest
12, pytest-astropy
13, pytestCheckHook
14, pyvo
15, astropy-helpers
16, setuptools
17, isPy3k
18}:
19
20buildPythonPackage rec {
21 pname = "astroquery";
22 version = "0.4.6";
23 format = "pyproject";
24
25 src = fetchPypi {
26 inherit pname version;
27 sha256 = "sha256-MHylVMtzSgypoi+G9e/+fkE6+ROuZeFXiXLYR7H+E+4=";
28 };
29
30 disabled = !isPy3k;
31
32 propagatedBuildInputs = [
33 astropy
34 requests
35 keyring
36 beautifulsoup4
37 html5lib
38 pyvo
39 ];
40
41 nativeBuildInputs = [ astropy-helpers setuptools ];
42
43 # Disable automatic update of the astropy-helper module
44 postPatch = ''
45 substituteInPlace setup.cfg --replace "auto_use = True" "auto_use = False"
46 '';
47
48 checkInputs = [
49 matplotlib
50 pillow
51 pytest
52 pytest-astropy
53 pytestCheckHook
54 ];
55
56 # Tests must be run in the build directory. The tests create files
57 # in $HOME/.astropy so we need to set HOME to $TMPDIR.
58 preCheck = ''
59 export HOME=$TMPDIR
60 cd build/lib
61 '';
62
63 pythonImportsCheck = [ "astroquery" ];
64
65 meta = with pkgs.lib; {
66 description = "Functions and classes to access online data resources";
67 homepage = "https://astroquery.readthedocs.io/";
68 license = licenses.bsd3;
69 maintainers = [ maintainers.smaret ];
70 };
71}