aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/development/python-modules/reproject/default.nix
blob: ccc76734461e5ba87165167cb1770a0d6bda2817 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{ lib
, buildPythonPackage
, fetchPypi
, fetchpatch
, numpy
, astropy
, astropy-healpix
, astropy-helpers
, extension-helpers
, scipy
, pytest
, pytest-astropy
, setuptools_scm
, cython
}:

buildPythonPackage rec {
  pname = "reproject";
  version = "0.7.1";

  src = fetchPypi {
    inherit pname version;
    sha256 = "1jsc3ad518vyys5987fr1achq8qvnz8rm80zp5an9qxlwr4zmh4m";
  };

  propagatedBuildInputs = [ numpy astropy astropy-healpix astropy-helpers scipy ];

  nativeBuildInputs = [ astropy-helpers cython extension-helpers setuptools_scm ];

  # Disable automatic update of the astropy-helper module
  postPatch = ''
    substituteInPlace setup.cfg --replace "auto_use = True" "auto_use = False"
  '';

  checkInputs = [ pytest pytest-astropy ];

  # Tests must be run in the build directory
  checkPhase = ''
    cd build/lib*
    pytest
  '';

  meta = with lib; {
    description = "Reproject astronomical images";
    homepage = "https://reproject.readthedocs.io";
    license = licenses.bsd3;
    maintainers = [ maintainers.smaret ];
  };
}