1{
2 lib,
3 astropy,
4 astropy-extension-helpers,
5 astropy-healpix,
6 buildPythonPackage,
7 cloudpickle,
8 cython,
9 dask,
10 fetchPypi,
11 fsspec,
12 numpy,
13 pytest-astropy,
14 pytestCheckHook,
15 pythonOlder,
16 scipy,
17 setuptools-scm,
18 zarr,
19}:
20
21buildPythonPackage rec {
22 pname = "reproject";
23 version = "0.14.0";
24 pyproject = true;
25
26 disabled = pythonOlder "3.10";
27
28 src = fetchPypi {
29 inherit pname version;
30 hash = "sha256-3TxPd2CEmKWDlE1nC2GnXBUASe/DNgZnS1GJoRo5u8A=";
31 };
32
33 postPatch = ''
34 substituteInPlace pyproject.toml \
35 --replace "cython==" "cython>=" \
36 --replace "numpy>=2.0.0rc1" "numpy"
37 '';
38
39 nativeBuildInputs = [
40 astropy-extension-helpers
41 cython
42 numpy
43 setuptools-scm
44 ];
45
46 propagatedBuildInputs = [
47 astropy
48 astropy-healpix
49 cloudpickle
50 dask
51 fsspec
52 numpy
53 scipy
54 zarr
55 ] ++ dask.optional-dependencies.array;
56
57 nativeCheckInputs = [
58 pytest-astropy
59 pytestCheckHook
60 ];
61
62 pytestFlagsArray = [
63 "build/lib*"
64 # Avoid failure due to user warning: Distutils was imported before Setuptools
65 "-p no:warnings"
66 # Uses network
67 "--ignore build/lib*/reproject/interpolation/"
68 # prevent "'filterwarnings' not found in `markers` configuration option" error
69 "-o 'markers=filterwarnings'"
70 ];
71
72 pythonImportsCheck = [ "reproject" ];
73
74 meta = with lib; {
75 description = "Reproject astronomical images";
76 downloadPage = "https://github.com/astropy/reproject";
77 homepage = "https://reproject.readthedocs.io";
78 changelog = "https://github.com/astropy/reproject/releases/tag/v${version}";
79 license = licenses.bsd3;
80 maintainers = with maintainers; [ smaret ];
81 };
82}