Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / pygmt / default.nix
blob31b9fdd7c3a12010593361a8c856642c9e2d8553
1 { lib
2 , stdenv
3 , pythonOlder
4 , buildPythonPackage
5 , fetchFromGitHub
6 , setuptools-scm
7 , gmt
8 , numpy
9 , netcdf4
10 , pandas
11 , packaging
12 , xarray
13 , pytest-mpl
14 , ipython
15 , ghostscript
16 , pytestCheckHook
19 buildPythonPackage rec {
20   pname = "pygmt";
21   version = "0.10.0";
22   format = "pyproject";
24   disabled = pythonOlder "3.9";
26   src = fetchFromGitHub {
27     owner = "GenericMappingTools";
28     repo = "pygmt";
29     rev = "refs/tags/v${version}";
30     hash = "sha256-+bkjqHjJIwk44u226q6xqeGmwMWleyc4lRfMZdDjVBA=";
31   };
33   postPatch = ''
34     substituteInPlace pygmt/clib/loading.py \
35       --replace "env.get(\"GMT_LIBRARY_PATH\", \"\")" "env.get(\"GMT_LIBRARY_PATH\", \"${gmt}/lib\")"
36   '';
38   nativeBuildInputs = [
39     setuptools-scm
40   ];
42   propagatedBuildInputs = [
43     numpy
44     netcdf4
45     pandas
46     packaging
47     xarray
48   ];
50   nativeCheckInputs = [
51     pytestCheckHook
52     pytest-mpl
53     ghostscript
54     ipython
55   ];
57   # The *entire* test suite requires network access
58   doCheck = false;
60   postBuild = ''
61     export HOME=$TMP
62   '';
64   pythonImportsCheck = [
65     "pygmt"
66   ];
68   meta = with lib; {
69     description = "A Python interface for the Generic Mapping Tools";
70     homepage = "https://github.com/GenericMappingTools/pygmt";
71     license = licenses.bsd3;
72     changelog = "https://github.com/GenericMappingTools/pygmt/releases/tag/v${version}";
73     # pygmt.exceptions.GMTCLibNotFoundError: Error loading the GMT shared library '/nix/store/r3xnnqgl89vrnq0kzxx0bmjwzks45mz8-gmt-6.1.1/lib/libgmt.dylib'
74     broken = stdenv.isDarwin;
75     maintainers = with maintainers; [ sikmir ];
76   };