about summary refs log tree commit diff
path: root/pkgs/development/python-modules/astroquery
diff options
context:
space:
mode:
authorSébastien Maret <sebastien.maret@icloud.com>2022-04-09 16:40:19 +0200
committerSébastien Maret <sebastien.maret@icloud.com>2022-04-09 16:44:02 +0200
commit9b227257e9de7d8ce04954ab556e64ee8218ce9c (patch)
tree023876948ee8ab3ef5225a0ef18dee481fa8963f /pkgs/development/python-modules/astroquery
parentbba4dd5dd2b26d4be1c10434c56de5f83c9a81a1 (diff)
python3Packages.astroquery: fix build and restore tests
Diffstat (limited to 'pkgs/development/python-modules/astroquery')
-rw-r--r--pkgs/development/python-modules/astroquery/default.nix34
1 files changed, 28 insertions, 6 deletions
diff --git a/pkgs/development/python-modules/astroquery/default.nix b/pkgs/development/python-modules/astroquery/default.nix
index 8853b1e9e08d9..a022c80b16b90 100644
--- a/pkgs/development/python-modules/astroquery/default.nix
+++ b/pkgs/development/python-modules/astroquery/default.nix
@@ -6,8 +6,12 @@
 , keyring
 , beautifulsoup4
 , html5lib
+, matplotlib
+, pillow
 , pytest
 , pytest-astropy
+, pytestCheckHook
+, pyvo
 , astropy-helpers
 , isPy3k
 }:
@@ -24,21 +28,39 @@ buildPythonPackage rec {
 
   disabled = !isPy3k;
 
-  propagatedBuildInputs = [ astropy requests keyring beautifulsoup4 html5lib ];
+  propagatedBuildInputs = [
+    astropy
+    requests
+    keyring
+    beautifulsoup4
+    html5lib
+    pyvo
+  ];
 
   nativeBuildInputs = [ astropy-helpers ];
 
-  # Tests disabled until pytest-astropy has been updated to include pytest-astropy-header
-  doCheck = false;
-  checkInputs = [ pytest pytest-astropy ];
+  # Disable automatic update of the astropy-helper module
+  postPatch = ''
+    substituteInPlace setup.cfg --replace "auto_use = True" "auto_use = False"
+  '';
+
+  checkInputs = [
+    matplotlib
+    pillow
+    pytest
+    pytest-astropy
+    pytestCheckHook
+  ];
 
   # Tests must be run in the build directory. The tests create files
   # in $HOME/.astropy so we need to set HOME to $TMPDIR.
-  checkPhase = ''
+  preCheck = ''
+    export HOME=$TMPDIR
     cd build/lib
-    HOME=$TMPDIR pytest
   '';
 
+  pythonImportsCheck = [ "astroquery" ];
+
   meta = with pkgs.lib; {
     description = "Functions and classes to access online data resources";
     homepage = "https://astroquery.readthedocs.io/";