1{ lib
2, buildPythonPackage
3, fetchPypi
4, python
5, geos
6, pytestCheckHook
7, cython
8, numpy
9}:
10
11buildPythonPackage rec {
12 pname = "pygeos";
13 version = "0.13";
14
15 src = fetchPypi {
16 inherit pname version;
17 sha256 = "sha256-HDcweKrVou/tHDnNcceXqiAzvzCH8191FrrIm+ULmGE=";
18 };
19
20 patches = [
21 # Adapt https://github.com/shapely/shapely/commit/4889bd2d72ff500e51ba70d5b954241878349562,
22 # backporting to pygeos
23 ./fix-for-geos-3-11.patch
24 ];
25
26 nativeBuildInputs = [
27 geos # for geos-config
28 cython
29 ];
30
31 propagatedBuildInputs = [ numpy ];
32
33 # The cythonized extensions are required to exist in the pygeos/ directory
34 # for the package to function. Therefore override of buildPhase was
35 # necessary.
36 buildPhase = ''
37 ${python.interpreter} setup.py build_ext --inplace
38 ${python.interpreter} setup.py bdist_wheel
39 '';
40
41 checkInputs = [
42 pytestCheckHook
43 ];
44
45 pythonImportsCheck = [ "pygeos" ];
46
47 meta = with lib; {
48 description = "Wraps GEOS geometry functions in numpy ufuncs.";
49 homepage = "https://github.com/pygeos/pygeos";
50 license = licenses.bsd3;
51 maintainers = with maintainers; [ nialov ];
52 };
53}
54