From 9b227257e9de7d8ce04954ab556e64ee8218ce9c Mon Sep 17 00:00:00 2001 From: Sébastien Maret Date: Sat, 9 Apr 2022 16:40:19 +0200 Subject: python3Packages.astroquery: fix build and restore tests --- .../python-modules/astroquery/default.nix | 34 ++++++++++++++++++---- 1 file changed, 28 insertions(+), 6 deletions(-) (limited to 'pkgs/development') 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/"; -- cgit 1.4.1