From 5e7213b61598f8b86ab806c297cf1a5bd0ad89f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Maret?= Date: Tue, 23 Jul 2019 12:15:59 +0200 Subject: [PATCH] pythonPackages.spectral-cube: add checkPhase --- .../python-modules/spectral-cube/default.nix | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/spectral-cube/default.nix b/pkgs/development/python-modules/spectral-cube/default.nix index 661bc6363f4..c28b249d192 100644 --- a/pkgs/development/python-modules/spectral-cube/default.nix +++ b/pkgs/development/python-modules/spectral-cube/default.nix @@ -3,20 +3,36 @@ , buildPythonPackage , astropy , radio_beam -, pytest }: +, pytest +, pytest-astropy +, astropy-helpers +}: buildPythonPackage rec { pname = "spectral-cube"; version = "0.4.4"; - doCheck = false; # the tests requires several pytest plugins that are not in nixpkgs - src = fetchPypi { inherit pname version; sha256 = "9051ede204b1e25b6358b5e0e573b624ec0e208c24eb03a7ed4925b745c93b5e"; }; - propagatedBuildInputs = [ astropy radio_beam pytest ]; + propagatedBuildInputs = [ astropy radio_beam ]; + + nativeBuildInputs = [ astropy-helpers ]; + + checkInputs = [ pytest pytest-astropy ]; + + # Disable automatic update of the astropy-helper module + postPatch = '' + substituteInPlace setup.cfg --replace "auto_use = True" "auto_use = False" + ''; + + # Tests must be run in the build directory + checkPhase = '' + cd build/lib + pytest + ''; meta = { description = "Library for reading and analyzing astrophysical spectral data cubes";