1{ lib
2, buildPythonPackage
3, fetchPypi
4, isPyPy
5, python
6, setuptools
7, numpy
8, zlib
9, netcdf
10, hdf5
11, curl
12, libjpeg
13, cython
14, cftime
15}:
16
17buildPythonPackage rec {
18 pname = "netCDF4";
19 version = "1.6.2";
20 format = "pyproject";
21
22 disabled = isPyPy;
23
24 src = fetchPypi {
25 inherit pname version;
26 hash = "sha256-A4KwL/aiiEGfb/7IXexA9FH0G4dVVHFUxXXd2fD0rlM=";
27 };
28
29 nativeBuildInputs = [ setuptools cython ];
30
31 propagatedBuildInputs = [
32 cftime
33 numpy
34 zlib
35 netcdf
36 hdf5
37 curl
38 libjpeg
39 ];
40
41 checkPhase = ''
42 pushd test/
43 NO_NET=1 NO_CDL=1 ${python.interpreter} run_all.py
44 '';
45
46 # Variables used to configure the build process
47 USE_NCCONFIG = "0";
48 HDF5_DIR = lib.getDev hdf5;
49 NETCDF4_DIR = netcdf;
50 CURL_DIR = curl.dev;
51 JPEG_DIR = libjpeg.dev;
52
53 pythonImportsCheck = [ "netCDF4" ];
54
55 meta = with lib; {
56 description = "Interface to netCDF library (versions 3 and 4)";
57 homepage = "https://github.com/Unidata/netcdf4-python";
58 changelog = "https://github.com/Unidata/netcdf4-python/raw/v${version}/Changelog";
59 maintainers = with maintainers; [ ];
60 license = licenses.mit;
61 };
62}