1{
2 lib,
3 fetchFromGitHub,
4 pythonOlder,
5 buildPythonPackage,
6 basemap,
7 gfortran,
8 netcdf4,
9 numpy,
10 python,
11 setuptools,
12 xarray,
13 wrapt,
14}:
15
16buildPythonPackage rec {
17 pname = "wrf-python";
18 version = "1.4.0";
19 format = "setuptools";
20
21 disabled = pythonOlder "3.7";
22
23 src = fetchFromGitHub {
24 owner = "NCAR";
25 repo = "wrf-python";
26 tag = "v${version}";
27 hash = "sha256-LvNorZ28j/O8fs9z6jhYWC8RcCDIwh7k5iR9iumCvnQ=";
28 };
29
30 nativeBuildInputs = [ gfortran ];
31
32 propagatedBuildInputs = [
33 basemap
34 numpy
35 setuptools
36 xarray
37 wrapt
38 ];
39
40 nativeCheckInputs = [ netcdf4 ];
41
42 checkPhase = ''
43 runHook preCheck
44 cd ./test/ci_tests
45 ${python.interpreter} utests.py
46 runHook postCheck
47 '';
48
49 pythonImportsCheck = [ "wrf" ];
50
51 meta = with lib; {
52 # `ModuleNotFoundError: No module named 'distutils.msvccompiler'` on Python 3.11
53 # `ModuleNotFoundError: No module named 'numpy.distutils'` on Python 3.12
54 broken = true;
55 description = "WRF postprocessing library for Python";
56 homepage = "http://wrf-python.rtfd.org";
57 license = licenses.asl20;
58 maintainers = with maintainers; [ mhaselsteiner ];
59 };
60}