git.iko.soy/typeable/nixpkgs
on master help sign in
pythonPackages.pyregion: add checkPhase
commit93a6bba94e4ed2780ad6e2571d9af2d74bba580e authorSébastien Maret <sebastien.maret@icloud.com> dateTue 23 Jul 2019, 13:50 (7 years ago) parentffd7159
1 file changed+28−2
pkgs/development/python-modules/pyregion/default.nix+28−2
pkgs/development/python-modules/pyregion/default.nix+28−2
@@ -1,18 +1,20 @@
11{ lib
22, buildPythonPackage
33, fetchPypi
4+, fetchpatch
45, pyparsing
56, numpy
67, cython
78, astropy
9+, astropy-helpers
10+, pytest
11+, pytest-astropy
812}:
913
1014buildPythonPackage rec {
1115 pname = "pyregion";
1216 version = "2.0";
1317
14− doCheck = false; # tests require pytest-astropy
15−
1618 src = fetchPypi {
1719 inherit pname version;
1820 sha256 = "a8ac5f764b53ec332f6bc43f6f2193ca13e8b7d5a3fb2e20ced6b2ea42a9d094";
@@ -25,6 +27,30 @@ buildPythonPackage rec {
2527 astropy
2628 ];
2729
30+ # Upstream patch needed for the test to pass
31+ patches = [
32+ (fetchpatch {
33+ name = "conftest-astropy-3-fix.patch";
34+ url = "https://github.com/astropy/pyregion/pull/136.patch";
35+ sha256 = "13yxjxiqnhjy9gh24hvv6pnwx7qic2mcx3ccr1igjrc3f881d59m";
36+ })
37+ ];
38+
39+ nativeBuildInputs = [ astropy-helpers ];
40+
41+ checkInputs = [ pytest pytest-astropy ];
42+
43+ # Disable automatic update of the astropy-helper module
44+ postPatch = ''
45+ substituteInPlace setup.cfg --replace "auto_use = True" "auto_use = False"
46+ '';
47+
48+ # Tests must be run in the build directory
49+ checkPhase = ''
50+ cd build/lib.*
51+ pytest
52+ '';
53+
2854 meta = with lib; {
2955 description = "Python parser for ds9 region files";
3056 homepage = https://github.com/astropy/pyregion;