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