pythonPackages.radio_beam: add checkPhase

This commit is contained in:
Sébastien Maret 2019-07-23 12:27:29 +02:00 committed by Frederik Rietdijk
parent 5e7213b615
commit 723382b0bf

View File

@ -1,14 +1,17 @@
{ lib { lib
, fetchPypi , fetchPypi
, buildPythonPackage , buildPythonPackage
, astropy }: , astropy
, pytest
, pytest-astropy
, astropy-helpers
, scipy
}:
buildPythonPackage rec { buildPythonPackage rec {
pname = "radio_beam"; pname = "radio_beam";
version = "0.3.1"; version = "0.3.1";
doCheck = false; # the tests requires several pytest plugins that are not in nixpkgs
src = fetchPypi { src = fetchPypi {
inherit pname version; inherit pname version;
sha256 = "1wgd9dyz3pcc9ighkclb6qfyshwbg35s57lz6k62jhcxpvp8r5zb"; sha256 = "1wgd9dyz3pcc9ighkclb6qfyshwbg35s57lz6k62jhcxpvp8r5zb";
@ -16,6 +19,21 @@ buildPythonPackage rec {
propagatedBuildInputs = [ astropy ]; propagatedBuildInputs = [ astropy ];
nativeBuildInputs = [ astropy-helpers ];
# Disable automatic update of the astropy-helper module
postPatch = ''
substituteInPlace setup.cfg --replace "auto_use = True" "auto_use = False"
'';
checkInputs = [ pytest pytest-astropy scipy ];
# Tests must be run in the build directory
checkPhase = ''
cd build/lib
pytest
'';
meta = { meta = {
description = "Tools for Beam IO and Manipulation"; description = "Tools for Beam IO and Manipulation";
homepage = http://radio-astro-tools.github.io; homepage = http://radio-astro-tools.github.io;