1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 python,
6 geos_3_11,
7 pytestCheckHook,
8 cython_0,
9 numpy,
10}:
11
12buildPythonPackage rec {
13 pname = "pygeos";
14 version = "0.14";
15 format = "setuptools";
16
17 src = fetchPypi {
18 inherit pname version;
19 hash = "sha256-MPvBf2SEQgC4UTO4hfz7ZVQbh3lTH270+P5GfT+6diM=";
20 };
21
22 nativeBuildInputs = [
23 geos_3_11 # for geos-config
24 cython_0
25 ];
26
27 propagatedBuildInputs = [ numpy ];
28
29 # The cythonized extensions are required to exist in the pygeos/ directory
30 # for the package to function. Therefore override of buildPhase was
31 # necessary.
32 buildPhase = ''
33 ${python.pythonOnBuildForHost.interpreter} setup.py build_ext --inplace
34 ${python.pythonOnBuildForHost.interpreter} setup.py bdist_wheel
35 '';
36
37 nativeCheckInputs = [ pytestCheckHook ];
38
39 pythonImportsCheck = [ "pygeos" ];
40
41 meta = with lib; {
42 description = "Wraps GEOS geometry functions in numpy ufuncs";
43 homepage = "https://github.com/pygeos/pygeos";
44 changelog = "https://github.com/pygeos/pygeos/blob/${version}/CHANGELOG.rst";
45 license = licenses.bsd3;
46 maintainers = teams.geospatial.members;
47 };
48}