aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/development/python-modules/pyproj/default.nix
blob: c000283e6de866986d078cb233672a1552d13664 (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
50
51
52
53
54
55
56
57
58
59
60
{ lib, buildPythonPackage, fetchFromGitHub, python, pkgs, pythonOlder, isPy27, substituteAll
, aenum
, cython
, pytestCheckHook
, mock
, numpy
, shapely
}:

buildPythonPackage rec {
  pname = "pyproj";
  version = "2.6.0";
  disabled = isPy27;

  src = fetchFromGitHub {
    owner = "pyproj4";
    repo = "pyproj";
    rev = "v${version}rel";
    sha256 = "0fyggkbr3kp8mlq4c0r8sl5ah58bdg2mj4kzql9p3qyrkcdlgixh";
  };

  # force pyproj to use ${pkgs.proj}
  patches = [
    (substituteAll {
      src = ./001.proj.patch;
      proj = pkgs.proj;
      projdev = pkgs.proj.dev;
    })
  ];

  buildInputs = [ cython pkgs.proj ];

  propagatedBuildInputs = [
    numpy shapely
  ] ++ lib.optional (pythonOlder "3.6") aenum;

  checkInputs = [ pytestCheckHook mock ];

  # prevent importing local directory
  preCheck = "cd test";
  pytestFlagsArray = [
    "--ignore=test_doctest_wrapper.py"
    "--ignore=test_datadir.py"
  ];

  disabledTests = [
    "alternative_grid_name"
    "transform_wgs84_to_alaska"
    "transformer_group__unavailable"
    "transform_group__missing_best"
    "datum"
    "repr"
  ];

  meta = {
    description = "Python interface to PROJ.4 library";
    homepage = "https://github.com/jswhit/pyproj";
    license = with lib.licenses; [ isc ];
  };
}