1{ lib, buildPythonPackage, fetchFromGitHub, python, pkgs, pythonOlder, substituteAll
2, aenum
3, cython
4, pytest
5, mock
6, numpy
7}:
8
9buildPythonPackage rec {
10 pname = "pyproj";
11 version = "2.2.2";
12
13 src = fetchFromGitHub {
14 owner = "pyproj4";
15 repo = "pyproj";
16 rev = "v${version}rel";
17 sha256 = "0mb0jczgqh3sma69k7237i38h09gxgmvmddls9hpw4f3131f5ax7";
18 };
19
20 # force pyproj to use ${pkgs.proj}
21 patches = [
22 (substituteAll {
23 src = ./001.proj.patch;
24 proj = pkgs.proj;
25 })
26 ];
27
28 buildInputs = [ cython pkgs.proj ];
29
30 propagatedBuildInputs = [
31 numpy
32 ] ++ lib.optional (pythonOlder "3.6") aenum;
33
34 checkInputs = [ pytest mock ];
35
36 # ignore rounding errors, and impure docgen
37 # datadir is ignored because it does the proj look up logic, which isn't relevant
38 checkPhase = ''
39 pytest . -k 'not alternative_grid_name \
40 and not transform_wgs84_to_alaska \
41 and not repr' \
42 --ignore=test/test_doctest_wrapper.py \
43 --ignore=test/test_datadir.py
44 '';
45
46 meta = {
47 description = "Python interface to PROJ.4 library";
48 homepage = "https://github.com/jswhit/pyproj";
49 license = with lib.licenses; [ isc ];
50 };
51}