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