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 hash = "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 nativeCheckInputs = [
49 matplotlib
50 pillow
51 pytest
52 pytest-astropy
53 pytestCheckHook
54 ];
55
56 pytestFlagsArray = [
57 # DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
58 "-W" "ignore::DeprecationWarning"
59 ];
60
61 # Tests must be run in the build directory. The tests create files
62 # in $HOME/.astropy so we need to set HOME to $TMPDIR.
63 preCheck = ''
64 export HOME=$TMPDIR
65 cd build/lib
66 '';
67
68 pythonImportsCheck = [ "astroquery" ];
69
70 meta = with pkgs.lib; {
71 description = "Functions and classes to access online data resources";
72 homepage = "https://astroquery.readthedocs.io/";
73 license = licenses.bsd3;
74 maintainers = [ maintainers.smaret ];
75 };
76}