1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pytestCheckHook,
6 pythonOlder,
7 replaceVars,
8
9 certifi,
10 cython,
11 numpy,
12 pandas,
13 proj,
14 setuptools,
15 shapely,
16 xarray,
17}:
18
19buildPythonPackage rec {
20 pname = "pyproj";
21 version = "3.7.2";
22 pyproject = true;
23
24 disabled = pythonOlder "3.11";
25
26 src = fetchFromGitHub {
27 owner = "pyproj4";
28 repo = "pyproj";
29 tag = version;
30 hash = "sha256-WV344gxcmq08sIUVevn6uD50FSy4JvLt4aret5ZakYQ=";
31 };
32
33 # force pyproj to use ${proj}
34 patches = [
35 (replaceVars ./001.proj.patch {
36 proj = proj;
37 projdev = proj.dev;
38 })
39 ];
40
41 build-system = [
42 cython
43 setuptools
44 ];
45
46 buildInputs = [ proj ];
47
48 dependencies = [ certifi ];
49
50 nativeCheckInputs = [
51 numpy
52 pandas
53 pytestCheckHook
54 shapely
55 xarray
56 ];
57
58 preCheck = ''
59 # import from $out
60 rm -r pyproj
61 '';
62
63 disabledTestPaths = [
64 "test/test_datadir.py"
65 ];
66
67 disabledTests = [
68 # The following tests try to access network and end up with a URLError
69 "test__load_grid_geojson_old_file"
70 "test_get_transform_grid_list"
71 "test_sync__area_of_use__list"
72 "test_sync__bbox__list"
73 "test_sync__download_grids"
74 "test_sync__file__list"
75 "test_sync__source_id__list"
76 "test_sync_download"
77 "test_transformer_group__download_grids"
78 ];
79
80 pythonImportsCheck = [
81 "pyproj"
82 "pyproj.crs"
83 "pyproj.transformer"
84 "pyproj.geod"
85 "pyproj.proj"
86 "pyproj.database"
87 "pyproj.list"
88 "pyproj.datadir"
89 "pyproj.network"
90 "pyproj.sync"
91 "pyproj.enums"
92 "pyproj.aoi"
93 "pyproj.exceptions"
94 ];
95
96 meta = with lib; {
97 description = "Python interface to PROJ library";
98 mainProgram = "pyproj";
99 homepage = "https://github.com/pyproj4/pyproj";
100 changelog = "https://github.com/pyproj4/pyproj/blob/${src.rev}/docs/history.rst";
101 license = licenses.mit;
102 maintainers = with maintainers; [
103 lsix
104 dotlambda
105 ];
106 teams = [ teams.geospatial ];
107 };
108}