2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
fetchpatch,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
substituteAll,
|
|
|
|
|
|
|
|
certifi,
|
|
|
|
cython,
|
|
|
|
mock,
|
|
|
|
numpy,
|
|
|
|
pandas,
|
|
|
|
proj,
|
|
|
|
shapely,
|
|
|
|
xarray,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyproj";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "3.6.1";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2023-08-22 20:05:09 +00:00
|
|
|
disabled = pythonOlder "3.9";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pyproj4";
|
|
|
|
repo = "pyproj";
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-ynAhu89VpvtQJRkIeVyffQHhd+OvWSiZzaI/7nd6fXA=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-04-13 19:44:15 +00:00
|
|
|
# force pyproj to use ${proj}
|
2020-04-24 23:36:52 +00:00
|
|
|
patches = [
|
|
|
|
(substituteAll {
|
|
|
|
src = ./001.proj.patch;
|
2021-04-13 19:44:15 +00:00
|
|
|
proj = proj;
|
|
|
|
projdev = proj.dev;
|
2020-04-24 23:36:52 +00:00
|
|
|
})
|
2024-06-05 15:53:02 +00:00
|
|
|
|
|
|
|
# fix test failure caused by update of EPSG DB
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/pyproj4/pyproj/commit/3f7c7e5bcec33d9b2f37ceb03c484ea318dff3ce.patch";
|
|
|
|
hash = "sha256-0J8AlInuhFDAYIBJAJ00XbqIanJY/D8xPVwlOapmLDE=";
|
|
|
|
})
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2021-04-13 19:44:15 +00:00
|
|
|
nativeBuildInputs = [ cython ];
|
|
|
|
buildInputs = [ proj ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs = [ certifi ];
|
2021-04-13 19:44:15 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-04-13 19:44:15 +00:00
|
|
|
mock
|
|
|
|
numpy
|
|
|
|
pandas
|
2024-06-05 15:53:02 +00:00
|
|
|
pytestCheckHook
|
|
|
|
shapely
|
2021-04-13 19:44:15 +00:00
|
|
|
xarray
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-04-13 19:44:15 +00:00
|
|
|
preCheck = ''
|
2022-11-21 17:40:18 +00:00
|
|
|
# import from $out
|
|
|
|
rm -r pyproj
|
2021-04-13 19:44:15 +00:00
|
|
|
'';
|
2020-12-07 07:45:13 +00:00
|
|
|
|
2021-04-13 19:44:15 +00:00
|
|
|
disabledTestPaths = [
|
2022-11-21 17:40:18 +00:00
|
|
|
"test/test_doctest_wrapper.py"
|
|
|
|
"test/test_datadir.py"
|
2020-12-07 07:45:13 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
2021-04-13 19:44:15 +00:00
|
|
|
# The following tests try to access network and end up with a URLError
|
|
|
|
"test__load_grid_geojson_old_file"
|
|
|
|
"test_get_transform_grid_list"
|
|
|
|
"test_get_transform_grid_list__area_of_use"
|
|
|
|
"test_get_transform_grid_list__bbox__antimeridian"
|
|
|
|
"test_get_transform_grid_list__bbox__out_of_bounds"
|
|
|
|
"test_get_transform_grid_list__contains"
|
|
|
|
"test_get_transform_grid_list__file"
|
|
|
|
"test_get_transform_grid_list__source_id"
|
|
|
|
"test_sync__area_of_use__list"
|
|
|
|
"test_sync__bbox__list"
|
|
|
|
"test_sync__bbox__list__exclude_world_coverage"
|
|
|
|
"test_sync__download_grids"
|
|
|
|
"test_sync__file__list"
|
|
|
|
"test_sync__source_id__list"
|
|
|
|
"test_sync_download"
|
|
|
|
"test_sync_download__directory"
|
|
|
|
"test_sync_download__system_directory"
|
|
|
|
"test_transformer_group__download_grids"
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
|
|
# proj-data grid required
|
|
|
|
"test_azimuthal_equidistant"
|
2020-12-07 07:45:13 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"pyproj"
|
|
|
|
"pyproj.crs"
|
|
|
|
"pyproj.transformer"
|
|
|
|
"pyproj.geod"
|
|
|
|
"pyproj.proj"
|
|
|
|
"pyproj.database"
|
|
|
|
"pyproj.list"
|
|
|
|
"pyproj.datadir"
|
|
|
|
"pyproj.network"
|
|
|
|
"pyproj.sync"
|
|
|
|
"pyproj.enums"
|
|
|
|
"pyproj.aoi"
|
|
|
|
"pyproj.exceptions"
|
|
|
|
];
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
meta = with lib; {
|
2022-11-21 17:40:18 +00:00
|
|
|
description = "Python interface to PROJ library";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "pyproj";
|
2021-04-13 19:44:15 +00:00
|
|
|
homepage = "https://github.com/pyproj4/pyproj";
|
2022-11-21 17:40:18 +00:00
|
|
|
changelog = "https://github.com/pyproj4/pyproj/blob/${src.rev}/docs/history.rst";
|
2024-01-02 11:29:13 +00:00
|
|
|
license = licenses.mit;
|
2024-06-05 15:53:02 +00:00
|
|
|
maintainers =
|
|
|
|
with maintainers;
|
|
|
|
teams.geospatial.members
|
|
|
|
++ [
|
|
|
|
lsix
|
|
|
|
dotlambda
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|